From d84aa5cbc1980d9c6a9273016d45be26a12dab7e Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Mon, 3 Nov 2014 21:06:40 -0600 Subject: [PATCH] Quiet clang warnings about unused arguments in general. Check if we are using clang, rather than simply if we are on OS X. Note: recent LLVM releases do not seem to need this anyway. --- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e20d044..d4a8632 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,6 @@ CFLAGS="$CFLAGS -Wall -std=gnu99 -g" case $host_os in *darwin*) HOST_OS=darwin; - LDFLAGS="$LDFLAGS -Qunused-arguments" ;; *freebsd*) HOST_OS=freebsd; @@ -63,6 +62,19 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], ) CFLAGS="$save_cflags $AM_CFLAGS" +AC_MSG_CHECKING([if compiling with clang]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ +#ifndef __clang__ + not clang +#endif + ]])], + [AC_MSG_RESULT([yes])] + [CLANG_FLAGS=-Qunused-arguments], + [AC_MSG_RESULT([no])] +) +CFLAGS="$CFLAGS $CLANG_CFLAGS" +LDFLAGS="$LDFLAGS $CLANG_FLAGS" + AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) AC_CHECK_FUNCS([getentropy issetugid memmem reallocarray]) AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strtonum])