This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add a __nowarn__ keyword
On Thu, 9 Aug 2007, Daniel Jacobowitz wrote:
> On Wed, Aug 08, 2007 at 10:35:54PM -0400, Kaveh R. GHAZI wrote:
> > If we go with __nowarn__ (or __warn__) I believe the syntax is well
> > defined since it mimics the long-standing __extension__ behavior. It
> > cleanly handles the push/pop paradigm because the handler code resides in
> > the parser. Any time it sees the __extesion__ or __nowarn__ token, the
> > parser saves the current value of the warning flag, consumes the token and
> > recurses parsing. When the recursion returns, it restores the old value
> > of the warning flag in question and proceeds. Simple.
>
> Correct me if I'm wrong, but won't this work in exactly the same set
> of cases where DJ's pragmas would work? They're the cases that don't
> care about his #2.
Maybe I don't understand your question, but the keyword vs pragma styles
clearly do not work in the same set of cases. At least, if by "cases" you
mean: locations in code where they can be placed and affect. If by
"cases" you mean: which warnings they can effectively silence, that I
don't know. I think both mechanisms have holes in warning coverage that
don't necessarily overlap.
Which interpretation did you mean?
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu