From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7970 invoked by alias); 6 Aug 2007 15:33:21 -0000 Received: (qmail 7923 invoked by uid 22791); 6 Aug 2007 15:33:20 -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; Mon, 06 Aug 2007 15:33:16 +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 0485B46DE01; Mon, 6 Aug 2007 10:33:14 -0500 (CDT) Date: Mon, 06 Aug 2007 15:33:00 -0000 From: Gabriel Dos Reis To: "Kaveh R. GHAZI" cc: Mark Mitchell , Richard Guenther , gcc-patches@gcc.gnu.org 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/msg00343.txt.bz2 On Mon, 6 Aug 2007, Kaveh R. GHAZI wrote: | On Sun, 5 Aug 2007, Mark Mitchell wrote: | | > Until we provide some way to turn off warnings in a local region of | > code, I'd rather we just accept that we can't be quite -Wcast-qual | > clean. Use it as an incentive to fix the compiler, either to make the | > warning smarter (by, for example, allowing casts in the argument to | > "free", or by allowing fine-grained warning control). | | 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