From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11612 invoked by alias); 10 Aug 2007 18:40:31 -0000 Received: (qmail 11531 invoked by uid 22791); 10 Aug 2007 18:40:31 -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; Fri, 10 Aug 2007 18:40:27 +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 l7AIdIwt013425; Fri, 10 Aug 2007 14:39:18 -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 l7AIdIeS024825; Fri, 10 Aug 2007 14:39:18 -0400 Received: from greed.delorie.com (vpn-14-110.rdu.redhat.com [10.11.14.110]) by post-office.corp.redhat.com (8.13.8/8.13.8) with ESMTP id l7AIdHr4020501; Fri, 10 Aug 2007 14:39:17 -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 l7AIdH4k022974; Fri, 10 Aug 2007 14:39:17 -0400 Received: (from dj@localhost) by greed.delorie.com (8.13.8/8.13.8/Submit) id l7AIdG0h022971; Fri, 10 Aug 2007 14:39:16 -0400 Date: Fri, 10 Aug 2007 18:40:00 -0000 Message-Id: <200708101839.l7AIdG0h022971@greed.delorie.com> From: DJ Delorie To: gdr@cs.tamu.edu CC: mark@codesourcery.com, lopezibanez@gmail.com, ghazi@caip.rutgers.edu, gcc-patches@gcc.gnu.org In-reply-to: (message from Gabriel Dos Reis on Thu, 9 Aug 2007 23:12:35 -0500 (CDT)) Subject: Re: Add a __nowarn__ keyword References: <46B9F0B5.1080302@gnu.org> <200708082254.l78MsIC8014802@greed.delorie.com> <20070809134017.GA10368@caradoc.them.org> <20070809143028.GA14681@caradoc.them.org> <6c33472e0708090805t210191f6r63832af3afdd0816@mail.gmail.com> <200708091531.l79FVI4w032104@greed.delorie.com> <46BB93CD.7070300@codesourcery.com> <87hcn8885y.fsf@soliton.cs.tamu.edu> <200708100200.l7A20oe8001939@greed.delorie.com> <200708100327.l7A3RUbm005253@greed.delorie.com> <200708100359.l7A3xEOq005749@greed.delorie.com> 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/msg00698.txt.bz2 Minor glitch... The #pragma to enable the diagnostic also enables the warn_foo flag that goes with it, so if we have code like: if (warn_foo) warning (OPT_foo, "..."); then we need to make sure the warning function is called. However, when we pop state, we don't restore all those warn_foo flags. So, popping state may result in some warnings showing up as "warning: foo". This happens because the default state in diagnostics.c is DK_UNSPECIFIED, not DK_IGNORED. We do this so that the call itself tells us the default; calls to warning() generate warnings, etc. Ideas? The only thing I can think of is if we're turning the option on when it was off, we can go into the classification table and tweak that entry to DK_IGNORED, but that assumes that all warning() calls using that option pass the right OPT_*.