From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23654 invoked by alias); 9 Aug 2007 14:41:12 -0000 Received: (qmail 23549 invoked by uid 22791); 9 Aug 2007 14:41:12 -0000 X-Spam-Check-By: sourceware.org Received: from rv-out-0910.google.com (HELO rv-out-0910.google.com) (209.85.198.189) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Aug 2007 14:41:05 +0000 Received: by rv-out-0910.google.com with SMTP id f5so380853rvb for ; Thu, 09 Aug 2007 07:41:03 -0700 (PDT) Received: by 10.140.250.14 with SMTP id x14mr597063rvh.1186670463347; Thu, 09 Aug 2007 07:41:03 -0700 (PDT) Received: by 10.141.1.13 with HTTP; Thu, 9 Aug 2007 07:41:03 -0700 (PDT) Message-ID: <6c33472e0708090741s2917e6c2qd8775a8eb7b6040a@mail.gmail.com> Date: Thu, 09 Aug 2007 14:41:00 -0000 From: "=?ISO-8859-1?Q?Manuel_L=F3pez-Ib=E1=F1ez?=" To: "Kaveh R. GHAZI" Subject: Re: Add a __nowarn__ keyword Cc: "Paolo Bonzini" , "Gabriel Dos Reis" , "Mark Mitchell" , gcc-patches@gcc.gnu.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <6c33472e0708080152i1fd84566pe806fc83f40df417@mail.gmail.com> <6c33472e0708080729n4d59f0bdn72a90a95a7881ad3@mail.gmail.com> <46B9F0B5.1080302@gnu.org> X-IsSubscribed: yes 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/msg00579.txt.bz2 On 08/08/07, Kaveh R. GHAZI wrote: > On Wed, 8 Aug 2007, Paolo Bonzini wrote: > > So this is encouraging, I added OPT_Wcast_qual to the warning statement > and now it obeys the #pragma (or _Pragma). However I'm still having one > last problem. The pragma interface is still on/off, not push/pop. I.e.: Can you commit that fix as obvious before we forget about it? Thanks. > Assuming you've corrected the missing OPT_Wcast_qual in c-typeck.c, if you > compile the above with -Wcast-qual -Werror, the code correctly avoids the > warnings on the line marked WARNING1. However we should still get a > warning for WARNING2 but we don't. I believe the pragma has changed the > behavior of gcc for the rest of the entire file. There is no "pop" at the > end of the inline function CONST_CAST. I don't think there should be any implicit "pop". The pragma is at file-scope level, so it makes sense it applies to the whole file unless you provide another pragma later. Even if the pragma were at function-body scope, I am not sure why you would assume an implicit "pop" at the end of the function. Making this particular pragmas context-aware or just location-aware (like #if-#endif) is a matter of the design we wish to implement. I don't think either of them would be easier than the other, specially for warnings that don't come from the front-end. > In order to see WARNING2, I have to uncomment the second pragma. But this > is bad IMHO because it overrides the command line. Does it change the warning to an error? If that works, we only need a new keyword "restore" or "default" that changes it to the command-line value (or default value if there was no command-line setting) and et voil=E1, it will work (at least for this case). It is not push/pop but it is a step forward and I think that would be completely equivalent to __nowarn__ but more powerful (although arguably, a bit more verbose, so perhaps __nowarn__ would be still useful). I had a look at diagnostics.c and I think the implementation would be easy. But without regular internet connection at home, I cannot really work on this right now. Kaveh, DJ, what do you think about this? Am I talking nonsense? Manuel.