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.

There was some recent discussion of this on the gcc-patches mailing
list.  Look for __nowarn__.

Ian

Reply via email to