mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] When building, don't use flags which cause compiler warning
@ 2015-05-26 17:51 Alex Dowad
  2015-05-26 18:18 ` Rich Felker
  0 siblings, 1 reply; 10+ messages in thread
From: Alex Dowad @ 2015-05-26 17:51 UTC (permalink / raw)
  To: musl

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-05-27 12:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-26 17:51 [PATCH] When building, don't use flags which cause compiler warning Alex Dowad
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

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).