This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How do I find when the diagnostic pragmas first came into gcc?
I'm documenting the use of the diagnostic pragmas:
|#pragma GCC diagnostic |kind option
|#pragma GCC diagnostic push|
|#pragma GCC diagnostic pop|
on a boost page talking about how developers might deal with gcc
warnings and was wondering how to figure out what test I could put into
a #if that would avoid trying to use these pragmas in releases that did
not support them yet.
Something like:
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
#endif
// code here that generates a spurious warning controlled by -Wformat
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif