From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18394 invoked by alias); 9 Aug 2007 15:21:56 -0000 Received: (qmail 18226 invoked by uid 22791); 9 Aug 2007 15:21:54 -0000 X-Spam-Check-By: sourceware.org Received: from caip.rutgers.edu (HELO caip.rutgers.edu) (128.6.236.16) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Aug 2007 15:21:44 +0000 Received: from caipclassic.rutgers.edu (caipclassic.rutgers.edu [128.6.237.54]) by caip.rutgers.edu (8.13.8/8.13.5) with ESMTP id l79FLZlL032746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 9 Aug 2007 11:21:35 -0400 Date: Thu, 09 Aug 2007 15:21:00 -0000 From: "Kaveh R. GHAZI" To: Daniel Jacobowitz cc: DJ Delorie , gcc-patches@gcc.gnu.org Subject: Re: Add a __nowarn__ keyword In-Reply-To: <20070809143028.GA14681@caradoc.them.org> Message-ID: References: <46B9F0B5.1080302@gnu.org> <200708082254.l78MsIC8014802@greed.delorie.com> <20070809134017.GA10368@caradoc.them.org> <20070809143028.GA14681@caradoc.them.org> 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/msg00583.txt.bz2 On Thu, 9 Aug 2007, Daniel Jacobowitz wrote: > On Thu, Aug 09, 2007 at 10:19:27AM -0400, Kaveh R. GHAZI wrote: > > 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? > > All of those. There shouldn't be anywhere you could put __nowarn__ > that you couldn't put a _Pragma, since that is a preprocessing > directive, not part of the C grammar. Nor can I see why one would > work for some warning that the other did not work for. The natural > usage style is somewhat different, depending on how the pragma is > defined... and obviously the implementation would be very different. _Pragma(diagnostic) is implement to obey the same rules as #pragma diagnostic with regards to placement. I.e. if you put a _Pragma anywhere inside a function definition, you will get an error. This is a limitation of _Pragma(diagnostic) not _Pragma(something-else). --Kaveh -- Kaveh R. Ghazi ghazi@caip.rutgers.edu