From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18100 invoked by alias); 10 Aug 2016 15:51:35 -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 18079 invoked by uid 89); 10 Aug 2016 15:51:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=occurrences, Hx-languages-length:1346 X-HELO: mail-wm0-f65.google.com Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 10 Aug 2016 15:51:27 +0000 Received: by mail-wm0-f65.google.com with SMTP id q128so10378705wma.1 for ; Wed, 10 Aug 2016 08:51:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=K3gKUiD9HtVTbHt3TJRpX3ugsihgOHw7PTNaepzfQh0=; b=Tw3jvUds0hVnuc7J3QfKKEP1PPO+RtSCAjZuZObow+ih38ZVZdCp2AKsnAs3E/+Map F1QERX9lwWlwRSy0kbB27hCg2UnAEbnvsh8JhLbB9U0q9f/ipNt8fm6+Ck8vHquzckZm jjjZJeVcNE2KM2NJY7X3AaF7xqIJdioAdVJLIrma6NiugnGFc1kqOP3dQxFfkAOsOd2E ecqEErAZ+wIYF8fQfQZyzhQjM1XFgptN/NMROBePg05dfzv9GXvZnWTWO8ZihxzWWPNF eSLHN/IUNPaI4Y3S315MbZLNhoBdx+t2WqQrichAURCTciT/ZMliuSeqO1Tr4GRe8woy gdhw== X-Gm-Message-State: AEkoous9J9/MCkZ6Jp9viS0z/KMjrurajjYcXPu1d9chN4sNmXL3t4C15OCySp3I04RwiQ== X-Received: by 10.28.50.3 with SMTP id y3mr4132666wmy.23.1470844284817; Wed, 10 Aug 2016 08:51:24 -0700 (PDT) Received: from [192.168.10.165] (94-39-152-88.adsl-ull.clienti.tiscali.it. [94.39.152.88]) by smtp.googlemail.com with ESMTPSA id m62sm8980322wmm.24.2016.08.10.08.51.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Aug 2016 08:51:23 -0700 (PDT) Subject: Re: [PATCH v2] cpp/c: Add -Wexpansion-to-defined To: Joseph Myers References: <1470823595-1471-1-git-send-email-bonzini@gnu.org> <59051c81-0056-3e01-54a6-07b71307965c@gnu.org> Cc: =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= , Gcc Patch List From: Paolo Bonzini Message-ID: <8b5eadee-eb4b-75a2-3f06-a11fae56600a@gnu.org> Date: Wed, 10 Aug 2016 15:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-SW-Source: 2016-08/txt/msg00835.txt.bz2 On 10/08/2016 17:33, Joseph Myers wrote: > On Wed, 10 Aug 2016, Paolo Bonzini wrote: > >> - stuff that is not enabled by anything should use OPT_Wpedantic, and > > No, lots of pedwarns are for usages that are (a) dubious enough we want to > diagnose them by default, and (b) required to be diagnosed by ISO C so > must become errors with -pedantic-errors. (You could argue about whether > we should have -fpermissive for C like for C++ and make some of those into > errors by default.) There are indeed many pedwarn(loc, 0, ...) occurrences in C++ (most, but not all, are "foo only available with -std=bar" which in the C front-end would use OPT_Wpedantic, OPT_W*compat be enabled by specific flags such as -Wvariadic-macros). In C I only see three: - overflowing floating-point constants: if (!MODE_HAS_INFINITIES (TYPE_MODE (type))) pedwarn (input_location, 0, "floating constant exceeds range of %qT", type); else warning (OPT_Woverflow, "floating constant exceeds range of %qT", type); - __FUNCTION__ outside function scope if (!ix && !current_function_decl) pedwarn (loc, 0, "%qD is not defined outside of function scope", decl); - macro redefinition For the first two it would not feel wrong at all to use permerror. The last one indeed is a very good example of a pedwarn. Paolo