From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29060 invoked by alias); 19 Nov 2001 18:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 29030 invoked by uid 71); 19 Nov 2001 18:56:01 -0000 Resent-Date: 19 Nov 2001 18:56:01 -0000 Resent-Message-ID: <20011119185601.29029.qmail@sourceware.cygnus.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Golubev I. N." Received:(qmail 26688 invoked from network); 19 Nov 2001 18:50:53 -0000 Received: from unknown (HELO zabor.mo.msk.ru) (195.170.194.222) by sourceware.cygnus.com with SMTP; 19 Nov 2001 18:50:53 -0000 Received: from d-fens.vdata.ru (d-fens.vdata.ru [192.168.168.62]) by zabor.mo.msk.ru (8.9.3/8.9.3) with SMTP id VAA77224 for ; Mon, 19 Nov 2001 21:50:50 +0300 (MSK) (envelope-from gin@mo.msk.ru) Received: (gin@localhost) by d-fens.vdata.ru (8.6.8.1/SCA-6.6) id SAA25444; Mon, 19 Nov 2001 18:50:50 GMT Message-Id:<02493bf9548983-gin@mo.msk.ru> Date: Tue, 13 Nov 2001 15:26:00 -0000 From: "Golubev I. N." To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: preprocessor/4902: no macro redef warnings X-SW-Source: 2001-11/txt/msg00302.txt.bz2 List-Id: >Number: 4902 >Category: preprocessor >Synopsis: no macro redef warnings >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: doc-bug >Submitter-Id: net >Arrival-Date: Mon Nov 19 10:56:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Golubev I. N. >Release: 3.0.2 >Organization: >Environment: System: host: build: target: configured with: >Description: Neil wrote in : > you get a warning iff -pedantic `(cpp)Undefining and Redefining Macros' does not say so. Neither does it explain (or refer to explanation) why that change of requiring `-pedantic' was made (making `gcc' different from many other compilers which warn by default). Perhaps some people think that redefn warnings `trigger frequently on harmless code' (as `-pedantic' description in `(cpp)Invocation' says), but I disagree. My experience shows that more often than not they detect real bugs. >How-To-Repeat: #define a 1 #define a 2 I expect: warnings like this: 2:warning: `a' redefined 1:warning: this is the location of the previous definition I get: no warnings. >Fix: 1. Add more granularity to cpp warning options. Allow redefn warnings to be enabled without requesting all `-pedantic' diagnostics. 2. Whether it done or not, document in `(cpp)Undefining and Redefining Macros' option required to get redefn warnings (or to suppress them, if they are re-enabled by default). >Release-Note: >Audit-Trail: >Unformatted: