diff options
| -rw-r--r-- | configure.ac | 2 | ||||
| -rwxr-xr-x | scripts/wrap-compiler-for-flag-check | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index eee0221..18321bc 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -80,7 +80,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ | |||
| 80 | AC_MSG_RESULT([$CLANG]) | 80 | AC_MSG_RESULT([$CLANG]) |
| 81 | AS_IF([test "x$CLANG" == "xyes"], [CLANG_FLAGS=-Qunused-arguments]) | 81 | AS_IF([test "x$CLANG" == "xyes"], [CLANG_FLAGS=-Qunused-arguments]) |
| 82 | 82 | ||
| 83 | # We want to check for compiler flag support, but there is no way to make | 83 | # We want to check for compiler flag support. Prior to clang v5.1, there was no way to make |
| 84 | # clang's "argument unused" warning fatal. So we invoke the compiler through a | 84 | # clang's "argument unused" warning fatal. So we invoke the compiler through a |
| 85 | # wrapper script that greps for this message. | 85 | # wrapper script that greps for this message. |
| 86 | saved_CC="$CC" | 86 | saved_CC="$CC" |
diff --git a/scripts/wrap-compiler-for-flag-check b/scripts/wrap-compiler-for-flag-check index 6fa77f0..ee1100c 100755 --- a/scripts/wrap-compiler-for-flag-check +++ b/scripts/wrap-compiler-for-flag-check | |||
| @@ -3,12 +3,16 @@ | |||
| 3 | # From kmcallister: | 3 | # From kmcallister: |
| 4 | # https://github.com/kmcallister/autoharden/blob/efaf5a16612589808c276a11536ea9a47071f74b/scripts/wrap-compiler-for-flag-check | 4 | # https://github.com/kmcallister/autoharden/blob/efaf5a16612589808c276a11536ea9a47071f74b/scripts/wrap-compiler-for-flag-check |
| 5 | 5 | ||
| 6 | # There is no way to make clang's "argument unused" warning fatal. So when | 6 | # Prior to clang v5.1, there was no way to make |
| 7 | # configure checks for supported flags, it runs $CC, $CXX, $LD via this | 7 | # clang's "argument unused" warning fatal. This |
| 8 | # wrapper. | 8 | # wrapper script that greps for this warning message. Newer clang's have no issues. |
| 9 | # | 9 | # |
| 10 | # Ideally the search string would also include 'clang: ' but this output might | 10 | # Ideally the search string would also include 'clang: ' but this output might |
| 11 | # depend on clang's argv[0]. | 11 | # depend on clang's argv[0]. |
| 12 | # | ||
| 13 | # This file is in the public domain. | ||
| 14 | set -o errexit | ||
| 15 | set -o nounset | ||
| 12 | 16 | ||
| 13 | if out=`"$@" 2>&1`; then | 17 | if out=`"$@" 2>&1`; then |
| 14 | echo "$out" | 18 | echo "$out" |
