How do I find when the diagnostic pragmas first came into gcc?

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

 



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




[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