From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108466 invoked by alias); 10 Aug 2016 11:32:19 -0000 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 Received: (qmail 108453 invoked by uid 89); 10 Aug 2016 11:32:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=fear, nonpedwarn, non-pedwarn, controlled X-HELO: mail-wm0-f66.google.com Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 10 Aug 2016 11:31:58 +0000 Received: by mail-wm0-f66.google.com with SMTP id i5so8952787wmg.2 for ; Wed, 10 Aug 2016 04:31:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FEam2vHtdpb6G/03q35TLRlP9sHKON3Myki+oiyXVFo=; b=Pa2Sip46HkzjAFa4Lsfw5HyE4Li0NWYmfw6DDPPMgdn1K+p7W47HoTKtFHd1XoGpOp QHK1sm+qG/iOWkO8Z4QA4cJOtSjZ7R+uMLPXZ8aS5OO7NSxVDAmNp5fGd8eZrGSFWhnS aG24RqzcK1l5YtjPiEl6fzSjJjGbZ4hrzkpmhOAAuTU4ER+8vUeK5HYOYnrPaFXcdzTs QksBg++9s/zwm4fr0Zs+NToZBBM6bxiRCc9WETpO8ndF2H5nEf+Ll0jAAMIsQLe9JwR7 6fHy+Wxgn0XOLhzAZ9FHzQti/+au1QnMu2q4jYKAT8bIsOaFGfd84OLfLE7phLQJkGS0 vylw== X-Gm-Message-State: AEkoouuQjBqaSQ8Qupl0G8Vf2N7U3sQOAJnU6oJ1otQT9VTTYdEjqCii7Fcp539gfz3MPTFO5YAb7KXUdfEIDQ== X-Received: by 10.28.157.214 with SMTP id g205mr2880289wme.34.1470828715463; Wed, 10 Aug 2016 04:31:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.28.85 with HTTP; Wed, 10 Aug 2016 04:31:14 -0700 (PDT) In-Reply-To: <1470823595-1471-1-git-send-email-bonzini@gnu.org> References: <1470823595-1471-1-git-send-email-bonzini@gnu.org> From: =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= Date: Wed, 10 Aug 2016 11:32:00 -0000 Message-ID: Subject: Re: [PATCH v2] cpp/c: Add -Wexpansion-to-defined To: Paolo Bonzini Cc: Gcc Patch List Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-08/txt/msg00800.txt.bz2 On 10 August 2016 at 11:06, Paolo Bonzini wrote: > While I disagree with their inclusion of the warning to -Wall, I think > it is a good addition overall. First, it is a logical extension of the > existing warning for breaking defined across a macro and its caller. > Second, it is good to make these warnings for `defined' available with > a command-line option other than -pedantic. In fact this warning is > not mandated by the standard and thus is a strange case of a non-pedwarn > enabled by -pedantic. As a side effect of using the command-line parsing > machinery to attach the new warning to -pedantic, it would become an > error for -pedantic-errors, which would be weird for a diagnostic that > is not mandated by the standard. Note that the definition of -pedantic-errors says: "in some cases where there is undefined behavior at compile-time". Thus, this would be allowed according to our current definitions. However, the definition of -Wpedantic does not mention that, thus it could be a pedwarn not controlled by -Wpedantic. My only fear is that people not using -Wpedantic nor -pedantic-errors expect that GNU extensions work. This is a GNU extension that defines something that is undefined according to ISO. Enabling the warning with -Wextra is just annoying those people who may not care about other compilers. Thus, my opinion is that the current definition of -Wpedantic is too restrictive and it should contain the "in some cases where there is undefined behavior at compile-time". And thus, this should be a pedwarn enabled by -Wpedantic, not by -Wextra and an error with -pedantic-errors. But you should wait for other opinions, specially Joseph, before redoing it, even if you agree with me. Cheers, Manuel.