This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]