[Asterisk-code-review] BuildSystem: Really do not pass unknown-warning options to t... (asterisk[15])

Alexander Traud asteriskteam at digium.com
Sat Jan 6 15:42:52 CST 2018


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/7861


Change subject: BuildSystem: Really do not pass unknown-warning options to the compiler.
......................................................................

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
---
M configure
M configure.ac
2 files changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/61/7861/1

diff --git a/configure b/configure
index 9131aa8..717ae2c 100755
--- a/configure
+++ b/configure
@@ -18652,7 +18652,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wdeclaration-after-statement support" >&5
 $as_echo_n "checking for -Wdeclaration-after-statement support... " >&6; }
-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
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 	AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
@@ -18704,7 +18704,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wno-format-truncation" >&5
 $as_echo_n "checking for -Wno-format-truncation... " >&6; }
-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
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 	AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation
@@ -18717,7 +18717,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wshadow" >&5
 $as_echo_n "checking for -Wshadow... " >&6; }
-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
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 	AST_SHADOW_WARNINGS=-Wshadow
diff --git a/configure.ac b/configure.ac
index 414cfa4..01ba0e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1223,7 +1223,7 @@
 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
@@ -1263,7 +1263,7 @@
 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
@@ -1273,7 +1273,7 @@
 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

-- 
To view, visit https://gerrit.asterisk.org/7861
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9b7747f649b27ff5e9f75c3db3fee4fe7a29621
Gerrit-Change-Number: 7861
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180106/3b8a8a89/attachment.html>


More information about the asterisk-code-review mailing list