Boost logo

Boost :

Subject: Re: [boost] Official warnings policy?
From: John Maddock (john_at_[hidden])
Date: 2009-11-11 04:18:55


> I don't know of any way to locally silence individual warnings on
> gcc.

With modern gcc (read: 4.3 and higher), you can use the following:

-----------snip---------
 #if defined(__GNUC__)
    #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

void foo(int bar
{
}

+#if defined(__GNUC__)
+ #pragma GCC diagnostic warning "-Wdeprecated-declarations"
+#endif

~~~~~~~~~~~

That doesn't quite work, how do you know that the user
wants -Wdeprecated-declarations to be set to "warning" after the include?
Could be the user has disabled that one on the command line, in which case
if we turn it back on, that's as annoying for the end user as warnings from
Boost! There was a time when some MSVC std lib headers behaved like that,
and believe me it was *seriously* annoying :-(

Regards, John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk