Subject: [boost] [Wiki] Changes in information about gcc warnings.
From: Patrick Horgan (phorgan1_at_[hidden])
Date: 2011-01-10 19:04:41
I did a first cut at adding information to the wiki
the changes in GCC that let you suppress warnings locally. It's
probably not useful to you, since it's only in gcc version 4.x and the
ability to push and pop the current state is very recent, in 4.6.
Nevertheless it needed documenting. There's a change to the behavior of
#pragma GCC system_header as well. It previously had to be at file
scope, and now can be anywhere in the file and affects from that point
forward. The new pragma:
#pragma GCC diagnostic <ignored|warning|error> "-WASPECIFICWARNINGOPTION"
#pragma GCC diagnostic ignored "-Wdeprecated-declarations".
Prior to 4.6 this also had to be at file scope. As of 4.6 it can be at
any line. With both it affects from that point forward.
#pragma GCC diagnostic <push|pop>
These two just showed up at 4.6 and can be at any line. Without them,
the previous pragma is not that useful because if you affect the users
flags they will not like you! lol! With them you can do what you
#pragma GCC diagnostic push
#pragma GCC diagnostic "-Wunitialized"
// your code here
#pragma GCC diagnostic pop
4.6 is the current development trunk, so consider this a heads up. I'm
trying to get from the gcc guys a good description of what preprocessor
checks can be done to determine what's available when. When I get it,
I'll add it to the wiki.
Of course, almost all of the time warnings represent real issues and
it's better to change your code to get rid of the warning and make it
more correct, than to change your code to have ugly pragmas that
suppress the warning.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk