summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDave Beckett <dave@dajobe.org>2017-01-08 13:57:31 -0800
committerDave Beckett <dave@dajobe.org>2017-01-08 13:57:31 -0800
commit0a196219b3b4873eb882f01a374f8356061c30af (patch)
treedb8db80d191734f1a0ed4381a0dfa7663c3951b8 /configure.ac
parentf7064a52602b29885d8d803ba2d3c12eeea93c6f (diff)
downloadraptor-0a196219b3b4873eb882f01a374f8356061c30af.tar.gz
Pull out OSX-specific and clang-specific warnings
OSX 10.2 + clang is too noisy with warnings in stdio.h
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac39
1 files changed, 34 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 4e63f3e1..c769f9b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,13 @@ AM_PROG_AR
AC_PROG_CC
AM_PROG_CC_C_O
AC_MSG_CHECKING(whether $CC is clang)
+CC_IS_CLANG=no
+if $CC 2>&1 | grep clang >/dev/null 2>&1; then
+ CC_IS_CLANG=yes
+else
+ :
+fi
+AC_MSG_RESULT($CC_IS_CLANG)
dnl Initialize libtool
LT_INIT
@@ -221,8 +228,6 @@ AC_DEFUN([REDLAND_CC_TRY_FLAG], [
# -Wsystem-headers : not debugging system
# -Wsign-conversion: : many int / unsigned int / size_t
# -Wunused-parameter : variables can be marked __attribute__('unused')
-#
-# Apple gcc specific (probably): -Wshorten-64-to-32
possible_warnings="\
-Wall \
-Wc++-compat \
@@ -255,13 +260,10 @@ possible_warnings="\
-Wsign-compare \
-Wstrict-prototypes \
-Wswitch-enum \
--Wundef \
-Wunreachable-code \
-Wunsafe-loop-optimizations \
-Wwrite-strings \
\
--Wshorten-64-to-32
-\
-Wno-conversion \
-Wno-missing-field-initializers \
-Wno-sign-conversion \
@@ -275,6 +277,33 @@ possible_warnings="\
-Wc99-c11-compat \
"
+# compiler specific warnings
+if test $CC_IS_CLANG = yes; then
+ # Clang
+ # -Wno-nullability-completeness : too noisy on OSX reporting
+ # warnings in stdio.h
+ possible_warnings="$possible_warnings \
+-Wno-nullability-completeness
+"
+fi
+
+# OS specific warnings
+case "${host_os}" in
+ darwin*)
+ # Apple gcc/clang specific:
+ # -Wshorten-64-to-32
+ possible_warnings="$possible_warnings \
+-Wshorten-64-to-32 \
+"
+ ;;
+ *)
+ # -Wundef : too noisy on OSX 10.12+ e.g. stdio.h fails
+ possible_warnings="$possible_warnings \
+-Wundef
+"
+ ;;
+esac
+
warning_cflags=
if test "$USE_MAINTAINER_MODE" = yes; then
AC_MSG_CHECKING(for supported $CC warning flags)