aboutsummaryrefslogtreecommitdiff
path: root/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
commit0b198ca38f9f58858ad8aa4bf91a2a06a6dee0e5 (patch)
tree2e5267d74b5e99671b0020b24aa9fc6dd2391ad9 /configure
parent111877dd12c60406a77f8cae702190d9762bcaed (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 13 insertions, 1 deletions
diff --git a/configure b/configure
index 95bf6107e3..d468759018 100755
--- a/configure
+++ b/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=