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: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 18 Mar 2002 17:39:14 +1100
- Subject: Re: pointer <-> integer conversion warnings (bogus -Wall warnings )
- References: <20020315124958.571C3F28C4@nile.gnat.com>
On 15-Mar-2002, Robert Dewar <dewar@gnat.com> wrote:
> One thing to perhaps mention again is that we really find the Warnings
> pragma in Ada to be very useful, ultimately we always have the following
> nicely local approach to dealing with "wrong" warnings:
>
> pragma Warnings (Off);
> -- comment on why warnings are being turned off
> ... dubious code that is in fact OK
> pragma Warnings (On);
...
> that's much more useful in some cases than switches which
>
> a) complicate the make files (or in the case of GNAT, project files)
> b) are too heavy handed, since they apply to an entire unit
I have in the past proposed that GNU C be extended to allow expressions
to be prefixed with `__no_warn__'. The semantics of this construct
would be similar to `__extension__', except that it would disable all
warnings for the expression that follows, not just warnings about the
use of GCC extensions.
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.
However, I think that even with this danger, `__no_warn__' would still
be worthwhile if used carefully.
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)'?
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.