From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25629 invoked by alias); 8 Aug 2007 19:51:45 -0000 Received: (qmail 25542 invoked by uid 22791); 8 Aug 2007 19:51:45 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Aug 2007 19:51:40 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l78JpZKT014292; Wed, 8 Aug 2007 15:51:35 -0400 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [10.11.254.111]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l78JpZlb031743; Wed, 8 Aug 2007 15:51:35 -0400 Received: from greed.delorie.com (vpn-14-4.rdu.redhat.com [10.11.14.4]) by post-office.corp.redhat.com (8.13.8/8.13.8) with ESMTP id l78JpZhR020715; Wed, 8 Aug 2007 15:51:35 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.13.8/8.13.8) with ESMTP id l78JpYHk010757; Wed, 8 Aug 2007 15:51:34 -0400 Received: (from dj@localhost) by greed.delorie.com (8.13.8/8.13.8/Submit) id l78JpYMU010754; Wed, 8 Aug 2007 15:51:34 -0400 To: "Kaveh R. GHAZI" Cc: gcc-patches@gcc.gnu.org Subject: Re: Add a __nowarn__ keyword References: <46B9F0B5.1080302@gnu.org> From: DJ Delorie Date: Wed, 08 Aug 2007 19:51:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00538.txt.bz2 "Kaveh R. GHAZI" writes: > extern __inline void *CONST_CAST(const void *cv) > { > return (void *)cv; > } > //#pragma GCC diagnostic error "-Wcast-qual" We don't really support changing the diagnostics *after* you start defining functions. If that happens to work at all, it's only by coincidence, especially with file-at-a-time optimizations and tree inlining. Push/pop functionality would have to be implemented along with a scheme to actually track per-function diagnostic settings, which we don't have. Then we start getting into the "can I disable warnings for this statement?" type requests. The current design is intended to provide, for example, project-wide defaults and policy settings, which work with things like -Wall -Werror to tailor the global defaults to project-specfic needs, or file-specific exceptions to them. So, always put those pragmas before any function definitions.