From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7799 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] add unused flag check arguments to toolchain flag detection Date: Wed, 27 May 2015 23:32:25 -0400 Message-ID: <20150528033225.GP17573@brightrain.aerifal.cx> References: <1432781410-7914-1-git-send-email-hi@shiz.me> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1432783962 9872 80.91.229.3 (28 May 2015 03:32:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 May 2015 03:32:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7811-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 28 05:32:41 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YxoYi-00029F-Kw for gllmg-musl@m.gmane.org; Thu, 28 May 2015 05:32:40 +0200 Original-Received: (qmail 1621 invoked by uid 550); 28 May 2015 03:32:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1599 invoked from network); 28 May 2015 03:32:38 -0000 Content-Disposition: inline In-Reply-To: <1432781410-7914-1-git-send-email-hi@shiz.me> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7799 Archived-At: On Thu, May 28, 2015 at 04:50:10AM +0200, Shiz wrote: > > this checks whether -Werror=unknown-warning-option and > -Werror=unused-command-line-argument are supported by the toolchain. if so, > it adds those flags to the tryflag and tryldflag checks in ./configure. > > so far only clang supports these flags, but clang is also the only toolchain > I've encountered that ignores unrecognized arguments instead of erroring out. > --- > configure | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) Thanks! The patch looks mostly good (except the -Wl, part that's wrong). I have some proposed changes to the message. The shortlog message should be clear on the what and where of the change: configure: work around compilers that only warn for unknown options Then, if not already clear, the body should express more about why and how, such as: some compilers (such as clang) accept unknown options without error, but then print warnings on each invocation, cluttering the build output and burying meaningful warnings. this patch makes configure's tryflag and tryldflag functions use additional options to turn the unknown-option warnings into errors, if available, but only at check time. these options are not output in config.mak to avoid the risk of spurious build breakage; if they work, they will have already done their job at configure time. FYI cparser/firm also supports -Werror=unknown-warning-option so it's not just clang. Rich