summaryrefslogtreecommitdiffstats
path: root/llvm/configure
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2013-01-15 18:21:15 +0000
committerDavid Greene <greened@obbligato.org>2013-01-15 18:21:15 +0000
commit57ad4297a3f3b15bde4190611781fdda1b94f7db (patch)
treec78dbfa8e3df9d31cf3414c2d175eaedf5b413d0 /llvm/configure
parent3d7eb2f80653d8b84760adf96281203ca41c7a88 (diff)
downloadbcm5719-llvm-57ad4297a3f3b15bde4190611781fdda1b94f7db.tar.gz
bcm5719-llvm-57ad4297a3f3b15bde4190611781fdda1b94f7db.zip
Disable Uninitialized Use Warnings for Broken gcc Versions
Some versions of gcc accept unsupported -W flags and run just fine if there are no warnings, but die with an unsupported flag error if a warning is encountered. gcc 4.3 and gcc 4.4 both exhibit this behavior for -Wno-maybe-uninitialized. Therefore, if the flag check for -Wno-maybe-uninitialized succeeds, only use -Wno-maybe-uninitialized if we are using gcc version 4.7 or greater. Use -Wno-uninitialized otherwise. llvm-svn: 172543
Diffstat (limited to 'llvm/configure')
-rwxr-xr-xllvm/configure14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/configure b/llvm/configure
index 95bf6107e3b..d4687590183 100755
--- a/llvm/configure
+++ b/llvm/configure
@@ -12257,7 +12257,19 @@ then
NO_UNINITIALIZED=`$CXX -Werror -Wno-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-uninitialized`
else
- NO_UNINITIALIZED=
+ gxx_version=`$CXX -dumpversion`
+ gxx_version_major=`echo $gxx_version | cut -d'.' -f1`
+ gxx_version_minor=`echo $gxx_version | cut -d'.' -f2`
+ gxx_version_patch=`echo $gxx_version | cut -d'.' -f3`
+
+ if test "$gxx_version_major" -ge "4" \
+ && test "$gxx_version_minor" -ge "7"; then
+ NO_UNINITIALIZED=
+ else
+ NO_MAYBE_UNINITIALIZED=
+ NO_UNINITIALIZED=`$CXX -Werror -Wno-uninitialized -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-uninitialized`
+
+ fi
fi
else
NO_UNINITIALIZED=
OpenPOWER on IntegriCloud