This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: [Off-topic] Wrote the suppressing warnings for GCC section of boost wiki page on Warning Guidelines
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: phorgan1 at yahoo dot com
- Cc: GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 14 Jan 2011 23:16:35 +0000
- Subject: Re: [Off-topic] Wrote the suppressing warnings for GCC section of boost wiki page on Warning Guidelines
- References: <4D30C8B9.3020803@yahoo.com>
On 14 January 2011 22:05, Patrick Horgan wrote:
> I added a section to the boost warnings guidelines page about suppressing
> warnings with GCC. ?I think it's pretty good bringing together information I
> got on this list, from reading the source and from browsing through the
> documentation for various releases of GCC. ?If anyone wants to check it for
> correctness I would be very appreciative. ?I would in particular like to
> thank Jonathan Wakely for his willingness to help and for the great help he
> gave me on this list.
>
> https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines
>
> If you scroll to the bottom directly you'll see the end of the section on
> suppressing GCC warnings.
In the example:
GCC_DIAG_OFF(sign-compare);
if(a < b){
GCC_DIAG_ON(sign-compare);
It might be worth mentioning that example assumes GCC 4.6, so the
macros work at function-scope (my fault for the bad example.)
And later on, it says "they risk future collision with GCC macros"
While I agree that macros should be named to avoid collisions, macros
defined by GCC will use the reserved namespace, i.e. begin with one or
two underscores followed by an uppercase letter, e.g. __GNUC__,
_GLIBCXX_DEBUG