From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21333 invoked by alias); 10 Aug 2007 04:12:41 -0000 Received: (qmail 21288 invoked by uid 22791); 10 Aug 2007 04:12:40 -0000 X-Spam-Check-By: sourceware.org Received: from postal.cs.tamu.edu (HELO postal.cs.tamu.edu) (128.194.138.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Aug 2007 04:12:38 +0000 Received: from gauss.cs.tamu.edu (gauss.cs.tamu.edu [128.194.146.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by postal.cs.tamu.edu (Postfix) with ESMTP id 858C646DE06; Thu, 9 Aug 2007 23:12:36 -0500 (CDT) Date: Fri, 10 Aug 2007 04:12:00 -0000 From: Gabriel Dos Reis To: DJ Delorie cc: mark@codesourcery.com, lopezibanez@gmail.com, ghazi@caip.rutgers.edu, gcc-patches@gcc.gnu.org Subject: Re: Add a __nowarn__ keyword In-Reply-To: <200708100359.l7A3xEOq005749@greed.delorie.com> Message-ID: References: <46B9F0B5.1080302@gnu.org> <200708082254.l78MsIC8014802@greed.delorie.com> <20070809134017.GA10368@caradoc.them.org> <20070809143028.GA14681@caradoc.them.org> <6c33472e0708090805t210191f6r63832af3afdd0816@mail.gmail.com> <200708091531.l79FVI4w032104@greed.delorie.com> <46BB93CD.7070300@codesourcery.com> <87hcn8885y.fsf@soliton.cs.tamu.edu> <200708100200.l7A20oe8001939@greed.delorie.com> <200708100327.l7A3RUbm005253@greed.delorie.com> <200708100359.l7A3xEOq005749@greed.delorie.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-08/txt/msg00641.txt.bz2 On Thu, 9 Aug 2007, DJ Delorie wrote: | | > and use the typedef instead? | | What, you don't like all those "structs" around? ;-) :-) :-) As you probably know by now, my brain has been altered by C++ :-) | > Is it correct that the "user interface" now is to say | > | > #pragma GCC push | | $pragma GCC diagnostics push | | > ? | | Yes. | | > If yes, is the "push" necessary? Can we make it implicit? | | So, a pop with no corresponding push, restores to... what? The way | the code is now, if you don't push or save, it never even starts the | chain - it doesn't know the difference between a command line setting | and a #pragma without a push. Thus, a pop wouldn't do anything | anyway. | | I think what you want is, an unmatched pop restores the command line | settings, yes? To do that, we'd need two things: | | 1. Something in gcc does the implicit save to start the chain, so that | all #pragma changes are in the chain and not the table. | | 2. An unmatched pop points you back at the head of the chain, which is | a no-op state created by that save. | | But then, there would be no way to restore some project-wide settings | pulled in by a #include. | | Or did you mean that a pop always pops just ONE #pragma? The current | structure allows that, easier if we move the state struct to | diagnostics.h. Then, you just restore to state->previous. But is | that a pop, or an undo? What I have in mind is something like this: 1. When we see #pragma GCC diagnostics foo we implicitly save thre current state, push a new one and modify that copy to match the requested setting foo. 2. When we see #pragma GCC diagnostics restore we pop the stack and restore the state to the previously known state. Is your point that that scheme is too simplistic to cover all we want or we would like to support? -- Gaby