From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4237 invoked by alias); 6 Aug 2007 17:59:08 -0000 Received: (qmail 4145 invoked by uid 22791); 6 Aug 2007 17:59:07 -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; Mon, 06 Aug 2007 17:59:05 +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 l76HulcR015762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Aug 2007 13:56:47 -0400 Date: Mon, 06 Aug 2007 17:59:00 -0000 From: "Kaveh R. GHAZI" To: Gabriel Dos Reis cc: Mark Mitchell , Richard Guenther , gcc-patches@gcc.gnu.org, dj@redhat.com Subject: Re: [PATCH]: Fix problematic -Wcast-qual cases using new CONST_CAST macro In-Reply-To: Message-ID: References: <84fc9c000707270219i4702de61y70899cd7e3349d72@mail.gmail.com> <84fc9c000707271138u6171f592x3f69800f12106a0a@mail.gmail.com> <87odhozdvp.fsf@soliton.cs.tamu.edu> <46B668EB.6080708@codesourcery.com> <46B6B038.7050601@codesourcery.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/msg00370.txt.bz2 On Mon, 6 Aug 2007, Gabriel Dos Reis wrote: > On Mon, 6 Aug 2007, Kaveh R. GHAZI wrote: > > | How about a __nowarn__ keyword that works similar to __extension__? > | Instead of twiddling the pedantic flag, it would push/pop the > | inhibit_warnings variable inside gcc to silence warnings at the statement > | level. > | > | I'm about halfway through a patch. If you're amenable to the idea I'll > | finish it up and post it. > > I would have thought that DJ's idea of using #pragma in code text > to turn on/off warning coupled with an inline function would do. > -- Gaby It would do, if it was finished. I don't know where that stands. Perhaps DJ could give us an update. BTW, I'm not sure I ever saw a specific description of how the #pragma syntax would look like. IMHO, I wouldn't do an on/off interface. Instead I think push/pop makes more sense. That way you restore the setting specified on the command line after the code region you're interested in. E.g. the __extension__ keyword uses push/pop semantics so that the -pedantic flag is left unchanged after the region it affects. --Kaveh -- Kaveh R. Ghazi ghazi@caip.rutgers.edu