Re: Warning Supression Doesn't Work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can anyone give an example statement that ignores a type of warning (for
example the "unused variable" warning") using the new #pragma GCC diagnostic
...? For the life of me, I can't figure out the proper syntax for this. The
only page I can find on #pragma GCC diagnostic is
http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html

How would I use -fdiagnostics-show-option that the above link mentions?

What I've tried is to put one of the following in foo.cpp:
#pragma GCC diagnostic ignored -Wunused
#pragma GCC diagnostic warning -Wunused
#pragma GCC diagnostic ignored "-Wunused"
#pragma GCC diagnostic warning "-Wunused"

Do I need to have a later version of gcc than 4.1.3 for it to work? GCC
simply says warning: ignoring #pragma GCC diagnostic
-- 
View this message in context: http://www.nabble.com/Warning-Supression-Doesn%27t-Work-tp17330928p17415726.html
Sent from the gcc - Help mailing list archive at Nabble.com.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux