[warning control] New #pragma GCC diagnostic

Mark Mitchell mark@codesourcery.com
Tue Jan 24 02:38:00 GMT 2006


DJ Delorie wrote:

> Does -w inhibit warnings before they're turned into errors?  Before
> the pragmas can turn individual warnings into errors?  Can the pragmas
> enable warnings which -w would have otherwise inhibited?

I think -w means no warnings come out of the compiler, period.  The user
will never see a diagnostic that starts with "warning:".  In other
words, conceptually, apply the -w filter late -- right when you're about
to say "warning:".  A #pragma that enables a warning still enables it,
but then it's not emitted.  If we had a #pragma for turning an error
into a warning, then that would still happen -- but you'd get no output
from the warning.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list