pragma-like warning turn off ?

Ian Lance Taylor iant@google.com
Wed Aug 22 18:08:00 GMT 2007


Robert Dewar <dewar@adacore.com> writes:

> Ian Lance Taylor wrote:
> 
> > It's fairly difficult.  You want a way to turn off specific warnings
> > for specific parts of the IR.  The IR is combined and rearranged
> > during optimization, so you need to figure out how to make the warning
> > control track those changes.
> 
> A simpler approach, used in the GNAT front end, is to keep a list of
> the warning on/off pragmas. Warnings are not output as they are
> generated but rather stored for later output.
> 
> Then after the compilation has completed, the warnings are sorted
> and generated, consulting the pragma list to see if they should
> be suppressed. This approach avoids the problems cited above
> entirely.

Nice.

Let's do that.

Ian



More information about the Gcc mailing list