public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [Off-topic] Wrote the suppressing warnings for GCC section of boost wiki page on Warning Guidelines
@ 2011-01-14 22:05 Patrick Horgan
  2011-01-14 23:17 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Horgan @ 2011-01-14 22:05 UTC (permalink / raw)
  To: GCC-help

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.

Thank you,

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Off-topic] Wrote the suppressing warnings for GCC section of boost wiki page on Warning Guidelines
  2011-01-14 22:05 [Off-topic] Wrote the suppressing warnings for GCC section of boost wiki page on Warning Guidelines Patrick Horgan
@ 2011-01-14 23:17 ` Jonathan Wakely
  2011-01-15  3:42   ` Patrick Horgan
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2011-01-14 23:17 UTC (permalink / raw)
  To: phorgan1; +Cc: GCC-help

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Off-topic] Wrote the suppressing warnings for GCC section of boost wiki page on Warning Guidelines
  2011-01-14 23:17 ` Jonathan Wakely
@ 2011-01-15  3:42   ` Patrick Horgan
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick Horgan @ 2011-01-15  3:42 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: GCC-help

On 01/14/2011 03:16 PM, Jonathan Wakely wrote:
> 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
Thanks, fixed both of these things.

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-15  3:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-14 22:05 [Off-topic] Wrote the suppressing warnings for GCC section of boost wiki page on Warning Guidelines Patrick Horgan
2011-01-14 23:17 ` Jonathan Wakely
2011-01-15  3:42   ` Patrick Horgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).