From: DJ Delorie <dj@redhat.com>
To: lopezibanez@gmail.com
Cc: gdr@cs.tamu.edu, mark@codesourcery.com, ghazi@caip.rutgers.edu,
gcc-patches@gcc.gnu.org
Subject: Re: Add a __nowarn__ keyword
Date: Fri, 10 Aug 2007 18:46:00 -0000 [thread overview]
Message-ID: <200708101845.l7AIjA8W023075@greed.delorie.com> (raw)
In-Reply-To: <6c33472e0708100303u18003efer69d4b45d7dc1ed58@mail.gmail.com> (lopezibanez@gmail.com)
> Do we have the scope-level information available when we emit
> diagnostics from the middle-end?
Not yet.
> How do you search for the current state given a scope?
Yet to be decided.
> Also, it is not clear to me how the scope of a pragma is defined by
> its location.
It's not, you wouldn't use pragmas for scoped changes.
> You may have several contradicting pragmas at file-scope
> (set to ignore, then restore), how you lookup the status in that
> case?
Whatever was in force at that time, which may be undefined for
pragmas.
> As Gabriel, I am a bit confused by what you want to achieve with the
> proposed push/pop.
Adding push/pop was a trivial change to the pragma handler. It exists
as an example of how to use the save/restore state tree code in
diagnostics.c. The same save/restore API can be used to keep track of
the diagnostic state for other purposes besides pragmas, like gcc's
__extension__.
> 2. DJ wants a header with stricter diagnostics that preserves the
> initial state and restores it at the end of the header
>
> #pragma GCC diagnostics error "-Whatever"
> #pragma GCC diagnostics error "-Whatever2"
> typical things within a header
> #pragma GCC diagnostics restore "-Whatever"
> #pragma GCC diagnostics restore "-Whatever2"
That assumes that there's a restore, and that it restores to the right
place (what if other headers have made global changes?)
> Yes, a simple #pragma GCC diagnostics restore may be shorter for
> case 2 when you have hundreds of pragmas. It will mean "undo all
> changes up to the previous pop/save operation or the initial
> state". But I think it will be a bit expensive operation when the
> user can simply do copy + paste + s/error/restore/
Did you look at my patch? A restore is a simple pointer assignment,
nothing more.
Plus, push/pop can be properly nested, whereas change/restore cannot,
unless you define "restore" as "pop" in which case you might as well
call it that.
next prev parent reply other threads:[~2007-08-10 18:46 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-27 8:15 [PATCH]: Fix problematic -Wcast-qual cases using new CONST_CAST macro Kaveh R. GHAZI
2007-07-27 9:53 ` Richard Guenther
2007-07-27 17:24 ` Kaveh R. GHAZI
2007-07-27 19:32 ` Richard Guenther
2007-07-27 19:37 ` Kaveh R. GHAZI
2007-07-27 20:28 ` Gabriel Dos Reis
2007-08-03 14:19 ` Kaveh R. GHAZI
2007-08-03 18:07 ` Gabriel Dos Reis
2007-08-06 0:19 ` Mark Mitchell
2007-08-06 0:32 ` Gabriel Dos Reis
2007-08-06 4:42 ` Kaveh R. GHAZI
2007-08-06 5:23 ` Mark Mitchell
2007-08-06 14:09 ` Kaveh R. GHAZI
2007-08-06 15:33 ` Gabriel Dos Reis
2007-08-06 17:59 ` Kaveh R. GHAZI
2007-08-06 18:11 ` DJ Delorie
2007-08-06 18:23 ` Gabriel Dos Reis
2007-08-06 18:18 ` Gabriel Dos Reis
2007-08-06 15:44 ` Mark Mitchell
2007-08-08 5:04 ` Add a __nowarn__ keyword Kaveh R. GHAZI
2007-08-08 8:52 ` Manuel López-Ibáñez
2007-08-08 9:04 ` Gabriel Dos Reis
2007-08-08 13:06 ` Kaveh R. GHAZI
2007-08-08 13:16 ` Gabriel Dos Reis
2007-08-08 13:48 ` Kaveh R. GHAZI
2007-08-08 13:58 ` Paolo Bonzini
2007-08-10 1:42 ` Gabriel Dos Reis
2007-08-08 14:29 ` Manuel López-Ibáñez
2007-08-08 15:25 ` Daniel Jacobowitz
2007-08-08 16:35 ` Paolo Bonzini
2007-08-08 19:31 ` Kaveh R. GHAZI
2007-08-08 19:42 ` Gabriel Dos Reis
2007-08-08 20:22 ` Paolo Bonzini
2007-08-08 19:51 ` DJ Delorie
2007-08-08 22:41 ` Kaveh R. GHAZI
2007-08-08 22:54 ` DJ Delorie
2007-08-09 2:36 ` Kaveh R. GHAZI
2007-08-09 13:40 ` Daniel Jacobowitz
2007-08-09 14:19 ` Kaveh R. GHAZI
2007-08-09 14:30 ` Daniel Jacobowitz
2007-08-09 15:05 ` Manuel López-Ibáñez
2007-08-09 15:15 ` Daniel Jacobowitz
2007-08-09 15:31 ` DJ Delorie
2007-08-09 22:23 ` Mark Mitchell
2007-08-09 22:43 ` Kaveh R. GHAZI
2007-08-10 1:52 ` Gabriel Dos Reis
2007-08-10 16:42 ` Mark Mitchell
2007-08-10 1:50 ` Gabriel Dos Reis
2007-08-10 2:02 ` DJ Delorie
2007-08-10 3:09 ` Gabriel Dos Reis
2007-08-10 3:28 ` DJ Delorie
2007-08-10 3:44 ` Gabriel Dos Reis
2007-08-10 4:00 ` DJ Delorie
2007-08-10 4:12 ` Gabriel Dos Reis
2007-08-10 4:23 ` DJ Delorie
2007-08-10 13:24 ` Gabriel Dos Reis
2007-08-10 18:40 ` DJ Delorie
2007-08-11 19:19 ` Joseph S. Myers
2007-08-13 18:36 ` DJ Delorie
2007-08-21 3:24 ` DJ Delorie
2009-11-21 12:24 ` Magnus Fromreide
2009-11-23 16:40 ` Manuel López-Ibáñez
2009-11-23 23:28 ` DJ Delorie
2007-08-10 19:05 ` DJ Delorie
2007-08-10 10:04 ` Manuel López-Ibáñez
2007-08-10 18:46 ` DJ Delorie [this message]
2007-08-09 15:21 ` Kaveh R. GHAZI
2007-08-09 16:48 ` Paolo Bonzini
2007-08-09 20:04 ` Ian Lance Taylor
2007-08-09 20:40 ` DJ Delorie
2007-08-10 1:47 ` Gabriel Dos Reis
2007-08-09 14:41 ` Manuel López-Ibáñez
2007-08-09 16:36 ` Gabriel Dos Reis
2007-08-09 23:14 ` Kaveh R. GHAZI
2007-08-09 22:55 ` Kaveh R. GHAZI
2007-08-10 3:18 ` Kaveh R. GHAZI
2007-08-10 3:25 ` Gabriel Dos Reis
2007-08-08 12:56 ` Kaveh R. GHAZI
2007-08-08 14:05 ` Manuel López-Ibáñez
2007-08-10 9:48 Paolo Bonzini
2007-08-10 16:53 ` Gabriel Dos Reis
2007-08-10 18:20 ` DJ Delorie
2007-08-10 18:40 ` Kaveh R. GHAZI
2007-08-10 18:52 ` DJ Delorie
2007-08-10 21:52 FX Coudert
2007-08-10 22:13 ` Kaveh R. GHAZI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200708101845.l7AIjA8W023075@greed.delorie.com \
--to=dj@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdr@cs.tamu.edu \
--cc=ghazi@caip.rutgers.edu \
--cc=lopezibanez@gmail.com \
--cc=mark@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).