c++ - pragma GCC diagnostic warning with GCC -
this question has answer here:
- how disable #pragma warnings? 4 answers
i use gcc 4.5.1 , warnings like:
warning: expected [error|warning|ignored] after '#pragma gcc diagnostic'
the reason "#pragma gcc diagnostic push", doesn't exist gcc < 4.6.
i can't change code (it not my) , gcc version too. how disable these warnings? gcc flags may be?
p.s. saw why "pragma gcc diagnostic push" pop warning in gcc/c++?, there isn't answer question.
gcc has these 2 flags control warnings regarding pragmas:
-wunknown-pragmas warn when "#pragma" directive encountered not understood gcc. if command-line option used, warnings issued unknown pragmas in system header files. not case if warnings enabled -wall command-line option.
-wno-pragmas not warn misuses of pragmas, such incorrect parameters, invalid syntax, or conflicts between pragmas. see -wunknown-pr
you can turn them off -wno-unknown-pragmas
.
Comments
Post a Comment