summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-08-03 12:30:31 -0400
committerCorey Farrell <git@cfware.com>2017-08-03 12:30:31 -0400
commitd066758a4c70f0461762d67b7333f78d85843bba (patch)
tree96d7a6b16e5d9522eff5b13af82ff8eca3cc53b6 /configure.ac
parented1bce956e30d9f8ec8defcbae33ea3217dd8fb6 (diff)
Fix compile error for old versions of GCC.
Use -Wno-format-truncation only if supported by compiler. ASTERISK-27171 #close Change-Id: Iac0aed7a5bcaa16c21b7d62c4e4678d244c4ccb6
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f40403e31..ced52c487 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1225,6 +1225,16 @@ else
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
+ AC_MSG_RESULT(yes)
+ AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation
+else
+ AC_MSG_RESULT(no)
+ AST_NO_FORMAT_TRUNCATION=
+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
AC_MSG_RESULT(yes)