Add a __nowarn__ keyword

Paolo Bonzini bonzini@gnu.org
Thu Aug 9 16:48:00 GMT 2007


> _Pragma(diagnostic) is implement to obey the same rules as #pragma
> diagnostic with regards to placement.  I.e. if you put a _Pragma anywhere
> inside a function definition, you will get an error.

Yes, and if we had a "push/pop" mechanism, we could limit 
_Pragma(diagnostic)'s effect to the current expression in the same way 
as __extension__/__nowarn__.

Regarding DJ's worry about unit-at-a-time etc., they obviously cannot 
apply to front-end generated warnings such as these. It is correct that 
GCC's currently implemented approach does not affect reliably warnings 
that are generated by the middle-end, but your __nowarn__ patch wouldn't 
work on them either.

Paolo



More information about the Gcc-patches mailing list