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 )


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.


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