c++ - pragma GCC diagnostic warning with GCC -


this question has answer here:

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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -