This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: pointer <-> integer conversion warnings (bogus -Wall warnings )
- From: dewar at gnat dot com (Robert Dewar)
- To: dewar at gnat dot com, fjh at cs dot mu dot OZ dot AU
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 18 Mar 2002 08:18:49 -0500 (EST)
- Subject: Re: pointer <-> integer conversion warnings (bogus -Wall warnings )
<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.