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: pragma-like warning turn off ?


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


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