pointer <-> integer conversion warnings (bogus -Wall warnings )

Robert Dewar dewar@gnat.com
Mon Mar 18 05:18:00 GMT 2002


<This proposal was criticized because it would disable all warnings, not
just the one spurious warning that you wanted to suppress.  This might
lead to warnings about real problems being suppressed.
>>

That's an amazing example to me of letting best be the enemy of good. The
trouble is that without this kind of feature, you have to turn off checks
for the entire compilation, or worse still, just decide that -Wall is
unusable.

<<In your experience with Ada, how often have real warnings been
suppressed because they occurred inside sections of code where
warnings had been disabled with `pragma Warnings (Off)'?
>>

Never, to my knowledge. It is very unusual for a single statement or
declaration to generate two independent warnings.

One thing we did add to GNAT recently was

pragma Unreferenced (name, name, ...)

which says that the given entities are deliberately not referenced (e.g.
unused subprogram parameters). This also suppresses the warnings (and
by the way generates a warning if one of the names *is* referenced). This
seemed a nice addition for clarifying intent.



More information about the Gcc mailing list