How portable is code that uses #pragma optimize? Do most compilers support it and how complete is the support for this #pragma?
How portable is code that uses #pragma optimize ? Do most compilers support it
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
#pragmais the sanctioned and portable way for compilers to add non-sanctioned and non-portable language extensions *.Basically, you never know for sure, and at least one major C++ compiler (g++) does not support this pragma as is.
*:
From the C++ standard (N3242):
From the C standard (Committee Draft — April 12, 2011):
And here’s an example:
A big part of the C and C++ OpenMP API is implemented as
#pragmas.