mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alex Dowad <alexinbeijing@gmail.com>
To: musl@lists.openwall.com
Subject: [PATCH] When building, don't use flags which cause compiler warning
Date: Tue, 26 May 2015 19:51:34 +0200	[thread overview]
Message-ID: <1432662694-13524-1-git-send-email-alexinbeijing@gmail.com> (raw)

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



             reply	other threads:[~2015-05-26 17:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 17:51 Alex Dowad [this message]
2015-05-26 18:18 ` Rich Felker
2015-05-26 18:36   ` [PATCH v2] When building, don't use compiler flags which cause warnings Alex Dowad
2015-05-26 18:47     ` Rich Felker
2015-05-26 18:55       ` Alex Dowad
2015-05-26 19:36         ` Rich Felker
2015-05-26 19:57           ` Alex Dowad
2015-05-27  2:22             ` Shiz
2015-05-27  3:14               ` Rich Felker
2015-05-27 12:30                 ` Shiz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432662694-13524-1-git-send-email-alexinbeijing@gmail.com \
    --to=alexinbeijing@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).