From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7769 Path: news.gmane.org!not-for-mail From: Alex Dowad Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] When building, don't use flags which cause compiler warning Date: Tue, 26 May 2015 19:51:34 +0200 Message-ID: <1432662694-13524-1-git-send-email-alexinbeijing@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1432662729 25730 80.91.229.3 (26 May 2015 17:52:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 May 2015 17:52:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7781-gllmg-musl=m.gmane.org@lists.openwall.com Tue May 26 19:52:03 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 1YxJ1G-0005CY-1A for gllmg-musl@m.gmane.org; Tue, 26 May 2015 19:52:02 +0200 Original-Received: (qmail 22266 invoked by uid 550); 26 May 2015 17:51:59 -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 22219 invoked from network); 26 May 2015 17:51:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=wbRPOaqElzEbnOhifPGnilCM5E35D8PC+72PjLxz/8w=; b=ttoRk8TewHPGT2llfL67fwcTr0RLreNV/afDCVKK2gmLJbYdltmrj2qsEBKXKsCA33 LJU6DkipcD0o8OUXD3SsnYTompo0a4bEflD/XIR4RtaU6c7YBIdWXKps+NnS3RuDLsg9 W9Xwtvtdmu/uQDuPkzOpNJq3LC+gaKgH3Ql8RY+PIqKyuQVzuVFZ5+EltTUR8bFu70cV ns08GQcltvO7sDJJMsBDFuFCdpBJUcbN3fHCdxSGk4wd+v/ev8tIgS7CW5rjnSwXwNa/ W/1N7MdjRYPDuis5pavMYqCpJiQS51d7uoXYuuLMfBMldZEVnkhzNbSoQWTARk+SI5ti RxsQ== X-Received: by 10.180.86.198 with SMTP id r6mr12996473wiz.70.1432662703798; Tue, 26 May 2015 10:51:43 -0700 (PDT) X-Mailer: git-send-email 2.0.0.GIT Xref: news.gmane.org gmane.linux.lib.musl.general:7769 Archived-At: A number of gcc flags are ignored by clang, and it prints annoying warnings to let you know. There is no reason to use these flags with a compiler which doesn't support them. --- Dear muslers, Not sure what you'll think of this... but please have a look. Thanks, Alex Dowad configure | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/configure b/configure index cf9227a..30daa97 100755 --- a/configure +++ b/configure @@ -80,11 +80,16 @@ fi tryflag () { printf "checking whether compiler accepts %s... " "$2" echo "typedef int x;" > "$tmpc" -if $CC $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then -printf "yes\n" -eval "$1=\"\${$1} \$2\"" -eval "$1=\${$1# }" -return 0 +if output=$($CC $2 -c -o /dev/null "$tmpc" 2>&1) ; then + if fnmatch '*warning*' "$output"; then + printf "disabled due to compiler warning\n" + return 1 + else + printf "yes\n" + eval "$1=\"\${$1} \$2\"" + eval "$1=\${$1# }" + return 0 + fi else printf "no\n" return 1 -- 2.0.0.GIT