This is the mail archive of the gcc-patches@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: Add a __nowarn__ keyword


> Is your point that that scheme is too simplistic to cover all we
> want or we would like to support?

Too simple.  Imagine a project-wide central header with dozens of
#pragmas that set up the warnings for the project.  Imagine lexical
scopes with multiple pragmas in them.  Imagine headers that want
stricter diagnostics, but need to preserve the state they started
with.

I think you want "undo", which undoes the most recent #pragma.  We can
add this along with the push/pop, but we're back to the original
question: Where/when does the state chain start?  Currently, we don't
start a chain until we see a push, so that if we don't use push/pop we
don't have to traverse the chain for every reported diagnostic.

If we implement undo, we're basically throwing that away, and starting
a chain with the first #pragma.


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