aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Johnson <daniel@daniel-johnson.org>2010-03-21 20:46:33 -0400
committerDaniel Stenberg <daniel@haxx.se>2010-03-22 19:44:45 +0100
commit3cd5b1cfb078cd7e96d7cd490740d955b7905caf (patch)
treef72a950153911debb868a058aa9398e698569f64
parent6572514ae544d69e71eb852ba9954211e8f81e27 (diff)
Fix warnings for clang
-rw-r--r--ares/m4/cares-compilers.m49
-rw-r--r--m4/curl-compilers.m49
2 files changed, 14 insertions, 4 deletions
diff --git a/ares/m4/cares-compilers.m4 b/ares/m4/cares-compilers.m4
index ae32988d7..3a5738971 100644
--- a/ares/m4/cares-compilers.m4
+++ b/ares/m4/cares-compilers.m4
@@ -835,11 +835,11 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
#
if test "$want_warnings" = "yes"; then
dnl All versions of clang support the same warnings as at least
- dnl gcc 4.2.1.
+ dnl gcc 4.2.1 except -Wunused.
tmp_CFLAGS="$tmp_CFLAGS -pedantic"
tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra"
tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings"
- tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow"
+ tmp_CFLAGS="$tmp_CFLAGS -Wshadow"
tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs"
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations"
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes"
@@ -853,6 +853,11 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
tmp_CFLAGS="$tmp_CFLAGS -Wcast-align"
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32"
+ #
+ dnl Only clang 1.1 or later
+ if test "$compiler_num" -ge "101"; then
+ tmp_CFLAGS="$tmp_CFLAGS -Wunused"
+ fi
fi
;;
#
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4
index 9577bf738..3f434d4c0 100644
--- a/m4/curl-compilers.m4
+++ b/m4/curl-compilers.m4
@@ -840,11 +840,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
#
if test "$want_warnings" = "yes"; then
dnl All versions of clang support the same warnings as at least
- dnl gcc 4.2.1.
+ dnl gcc 4.2.1 except -Wunused.
tmp_CFLAGS="$tmp_CFLAGS -pedantic"
tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra"
tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings"
- tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow"
+ tmp_CFLAGS="$tmp_CFLAGS -Wshadow"
tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs"
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations"
tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes"
@@ -858,6 +858,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
tmp_CFLAGS="$tmp_CFLAGS -Wcast-align"
tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers"
tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32"
+ #
+ dnl Only clang 1.1 or later
+ if test "$compiler_num" -ge "101"; then
+ tmp_CFLAGS="$tmp_CFLAGS -Wunused"
+ fi
fi
;;
#