diff options
author | Brent Cook <bcook@openbsd.org> | 2014-11-03 21:06:40 -0600 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2014-11-03 21:06:40 -0600 |
commit | d84aa5cbc1980d9c6a9273016d45be26a12dab7e (patch) | |
tree | 306474ef6b4b9b52c85059713e5429dae00cfe9d | |
parent | 94ec2b6b1c05e6047ecf02bc74776d0ad84f71cf (diff) | |
download | portable-d84aa5cbc1980d9c6a9273016d45be26a12dab7e.tar.gz portable-d84aa5cbc1980d9c6a9273016d45be26a12dab7e.tar.bz2 portable-d84aa5cbc1980d9c6a9273016d45be26a12dab7e.zip |
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.
-rw-r--r-- | configure.ac | 14 |
1 files changed, 13 insertions, 1 deletions
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" | |||
11 | case $host_os in | 11 | case $host_os in |
12 | *darwin*) | 12 | *darwin*) |
13 | HOST_OS=darwin; | 13 | HOST_OS=darwin; |
14 | LDFLAGS="$LDFLAGS -Qunused-arguments" | ||
15 | ;; | 14 | ;; |
16 | *freebsd*) | 15 | *freebsd*) |
17 | HOST_OS=freebsd; | 16 | HOST_OS=freebsd; |
@@ -63,6 +62,19 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], | |||
63 | ) | 62 | ) |
64 | CFLAGS="$save_cflags $AM_CFLAGS" | 63 | CFLAGS="$save_cflags $AM_CFLAGS" |
65 | 64 | ||
65 | AC_MSG_CHECKING([if compiling with clang]) | ||
66 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ | ||
67 | #ifndef __clang__ | ||
68 | not clang | ||
69 | #endif | ||
70 | ]])], | ||
71 | [AC_MSG_RESULT([yes])] | ||
72 | [CLANG_FLAGS=-Qunused-arguments], | ||
73 | [AC_MSG_RESULT([no])] | ||
74 | ) | ||
75 | CFLAGS="$CFLAGS $CLANG_CFLAGS" | ||
76 | LDFLAGS="$LDFLAGS $CLANG_FLAGS" | ||
77 | |||
66 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) | 78 | AC_CHECK_FUNCS([arc4random_buf asprintf explicit_bzero funopen getauxval]) |
67 | AC_CHECK_FUNCS([getentropy issetugid memmem reallocarray]) | 79 | AC_CHECK_FUNCS([getentropy issetugid memmem reallocarray]) |
68 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strtonum]) | 80 | AC_CHECK_FUNCS([strlcat strlcpy strndup strnlen strtonum]) |