From aa52c52b215405dc467800c0ee4e888fb10376e1 Mon Sep 17 00:00:00 2001 From: Alexander Traud Date: Sat, 6 Jan 2018 22:40:46 +0100 Subject: BuildSystem: Really do not pass unknown-warning options to the compiler. When an older GCC version is called with a too new warning option, GCC exited with an error and Asterisk was not built. Therefore, the configure script tests the installed compiler whether it supports that warning option. If not, Asterisk does not pass it to the installed compiler. However, some compilers (like clang) do not exit (error) but give just a warning in such a case. Because the compiler did not exit, Asterisk passed the unknown-warning option. ASTERISK-27560 Change-Id: Ia9b7747f649b27ff5e9f75c3db3fee4fe7a29621 --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index c617cf084..e333fafa1 100644 --- a/configure.ac +++ b/configure.ac @@ -1196,7 +1196,7 @@ LDFLAGS="${saved_sanitize_LDFLAGS}" AC_SUBST(AST_UNDEFINED_SANITIZER) AC_MSG_CHECKING(for -Wdeclaration-after-statement support) -if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then +if $(${CC} -Wdeclaration-after-statement -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then AC_MSG_RESULT(yes) AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement else @@ -1236,7 +1236,7 @@ fi AC_SUBST(AST_NO_STRICT_OVERFLOW) AC_MSG_CHECKING(for -Wno-format-truncation) -if $(${CC} -O2 -Wno-format-truncation -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then +if $(${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then AC_MSG_RESULT(yes) AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation else @@ -1246,7 +1246,7 @@ fi AC_SUBST(AST_NO_FORMAT_TRUNCATION) AC_MSG_CHECKING(for -Wshadow) -if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then +if $(${CC} -Wshadow -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then AC_MSG_RESULT(yes) AST_SHADOW_WARNINGS=-Wshadow else -- cgit v1.2.3