Add GCC 7 warning checks (Issue 383)

pull/354/merge
Jeffrey Walton 2017-03-01 23:40:47 -05:00
parent b791234b53
commit ab1477c7a5
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 8 additions and 0 deletions

View File

@ -229,6 +229,7 @@ fi
# Now that the compiler is fixed, determine the compiler version for fixups
CLANG_37_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'clang version (3\.[7-9]|[4-9]\.[0-9])')
GCC_70_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (7\.[0-9]|[8-9])')
GCC_60_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (6\.[0-9]|[7-9])')
GCC_51_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (5\.[1-9]|[6-9])')
GCC_48_COMPILER=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version 4\.8')
@ -1073,6 +1074,9 @@ if [[ ("$GCC_COMPILER" -ne "0") ]]; then
WARNING_CXXFLAGS+=("-Wall" "-Wextra" "-Wno-unknown-pragmas" "-Wstrict-aliasing=3" "-Wstrict-overflow" "-Wcast-align"
"-Waggressive-loop-optimizations" "-Wwrite-strings" "-Wformat=2" "-Wformat-security" "-Wtrampolines")
if [[ ("$GCC_70_OR_ABOVE" -ne "0") ]]; then
WARNING_CXXFLAGS+=("-Wrestrict -Wduplicated-branches -Wregister")
fi
if [[ ("$GCC_60_OR_ABOVE" -ne "0") ]]; then
WARNING_CXXFLAGS+=("-Wshift-negative-value -Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Wodr-type-mismatch")
fi

View File

@ -229,6 +229,7 @@ fi
# Now that the compiler is fixed, determine the compiler version for fixups
CLANG_37_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'clang version (3\.[7-9]|[4-9]\.[0-9])')
GCC_70_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (7\.[0-9]|[8-9])')
GCC_60_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (6\.[0-9]|[7-9])')
GCC_51_OR_ABOVE=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version (5\.[1-9]|[6-9])')
GCC_48_COMPILER=$("$CXX" -v 2>&1 | "$EGREP" -i -c 'gcc version 4\.8')
@ -1073,6 +1074,9 @@ if [[ ("$GCC_COMPILER" -ne "0") ]]; then
WARNING_CXXFLAGS+=("-Wall" "-Wextra" "-Wno-unknown-pragmas" "-Wstrict-aliasing=3" "-Wstrict-overflow" "-Wcast-align"
"-Waggressive-loop-optimizations" "-Wwrite-strings" "-Wformat=2" "-Wformat-security" "-Wtrampolines")
if [[ ("$GCC_70_OR_ABOVE" -ne "0") ]]; then
WARNING_CXXFLAGS+=("-Wrestrict -Wduplicated-branches -Wregister")
fi
if [[ ("$GCC_60_OR_ABOVE" -ne "0") ]]; then
WARNING_CXXFLAGS+=("-Wshift-negative-value -Wshift-overflow=2 -Wnull-dereference -Wduplicated-cond -Wodr-type-mismatch")
fi