From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17486 invoked by alias); 17 Oct 2014 23:32:09 -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 17474 invoked by uid 89); 17 Oct 2014 23:32:08 -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 X-HELO: mail-wg0-f52.google.com Received: from mail-wg0-f52.google.com (HELO mail-wg0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 17 Oct 2014 23:32:07 +0000 Received: by mail-wg0-f52.google.com with SMTP id a1so1865930wgh.11 for ; Fri, 17 Oct 2014 16:32:04 -0700 (PDT) X-Received: by 10.180.104.199 with SMTP id gg7mr2201040wib.41.1413588724437; Fri, 17 Oct 2014 16:32:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.217.80.73 with HTTP; Fri, 17 Oct 2014 16:31:44 -0700 (PDT) In-Reply-To: References: From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Fri, 17 Oct 2014 23:43:00 -0000 Message-ID: Subject: Re: [PATCH doc] Explain options precedence and difference between -pedantic-errors and -Werror=pedantic To: "Joseph S. Myers" Cc: Gcc Patch List Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-10/txt/msg01799.txt.bz2 On 17 October 2014 22:46, Joseph S. Myers wrote: >> @@ -3318,8 +3327,8 @@ >> >> @item -pedantic-errors >> @opindex pedantic-errors >> -Like @option{-Wpedantic}, except that errors are produced rather than >> -warnings. >> +This is equivalent to @option{-Werror=pedantic} plus making into errors >> +a few warnings that are not controlled by @option{-Wpedantic}. > > But I think the previous version is better here. Maybe at present your > version is true, but in principle -Wpedantic can control warnings that > aren't pedwarns. Some of the -Wformat warnings are conditional on having > both -Wformat and -Wpedantic enabled - we can only represent those using > OPT_Wformat in the warning calls at present, but there's at least as case > for -Werror=pedantic to turn them into errors (while -pedantic-errors > definitely should not turn them into errors, as the code is only invalid > at runtime and is valid at compile time as long as it never gets > executed). The previous version also does not match your description. You are saying that -Wpedantic = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic) and -pedantic-errors = pedwarn(OPT_Wpedantic).+ pedwarn(0) The current version says that -Wpedantic = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic) and -pedantic-errors = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic) My proposal says that: -Wpedantic = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic) and -pedantic-errors = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic) + pedwarn(0) which perhaps is not how it should be, but it is strictly more correct in the sense that it is wrong in exactly the same thing but it is right in one more than the current version. Cheers, Manuel.