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

Robert Dewar dewar@gnat.com
Fri Mar 15 04:50:00 GMT 2002


<<PS: and no, I'm not affiliated with any of the companies that may be "over"
represented in the SC, but just like th eidea that whenever I code something
potentially dangerous, I get warned by the compiler; as long as I can silent
that I'm happy, and like the idea the silenting is not a "once and forever"
but may be breaked if the architecture I compile for is a bit more exotic
than I have expected...
>>

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

(this is by the way not an Ada pragma really, but a GNAT pragma)



More information about the Gcc mailing list