From owner-svn-src-all@FreeBSD.ORG Wed Oct 26 20:55:49 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC286106566C; Wed, 26 Oct 2011 20:55:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id 887F48FC08; Wed, 26 Oct 2011 20:55:49 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p9QKtkwf005521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Oct 2011 07:55:47 +1100 Date: Thu, 27 Oct 2011 07:55:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Best In-Reply-To: <20111026182854.GA73322@freebsd.org> Message-ID: <20111027071802.T3703@besplex.bde.org> References: <201110231627.p9NGR47P046269@svn.freebsd.org> <20111026182854.GA73322@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Robert Millan Subject: Re: svn commit: r226665 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2011 20:55:50 -0000 On Wed, 26 Oct 2011, Alexander Best wrote: > On Sun Oct 23 11, Robert Millan wrote: >> Log: >> Conditionalize a pair of FreeBSD GCC extensions so that its CFLAGS are only >> used with FreeBSD GCC. > > any reason -f* flags were added to CWARNFLAGS in the first place? they aren't > really warnings, are they, so adding them to CFLAGS makes more sense imo. -fformat-extensions is added to CWARNFLAGS because it is a modifier to -Wformat. It was originally (in bsd.kern.mk 1.10) placed immediately after -Wformat in CWARNFLAGS, and was added in the same commit as -Wformat (since -Wformat could not be added before -fformat-extensions was developed to allow it to be added without breaking kernel builds). This is partially explained in the commit message. This was obfuscated (in bsd.kern.mk 1.14) by removing -Wformat. 1.13 had made -Wformat redundant by adding -Wall. This is not explained in the commit message. > diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk > index a0a595f..91560e0 100644 > --- a/sys/conf/kern.mk > +++ b/sys/conf/kern.mk > @@ -3,10 +3,9 @@ > # > # Warning flags for compiling the kernel and components of the kernel: > # > -CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ > - -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ > - -Wundef -Wno-pointer-sign -fformat-extensions \ > - -Wmissing-include-dirs -fdiagnostics-show-option > +CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes\ > + -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual\ > + -Wundef -Wno-pointer-sign -Wmissing-include-dirs Neither of these should be moved, except within CWARNFLAGS. For -fformat-extensions, see above. -fdiagnostics-show option is even more closely related with warning flags and even better documented in its commit message, as you should know since you submitted it :-). Actually, the commit message seems to tie it more closely with warning flags than it actually is -- it says that "it will report which -W* flag was responsible for triggering a certain warning", while gcc(1) says that it is for reporting of general diagnostics. -Wformat and -fformat-extensions were originally at the end of CWARNFLAGS. -fformat-extensions wasn't moved to be with -Wall when that was added. Keeping it at the end is reasonable. But it shouldn't be in the middle of random -W flags like it now is. All of the -W options are unfortunately unsorted by adding them to the end of the unsorted list. Some old versions even added -std=c99 to the end. Since -std has nothing to do with warning flags, that was nonsense and has been fixed. -fdiagnostics-show-option controls all the warning flags, so it would be better placed at the beginning. Bruce