Disable some warnings when using clang.
authorZoltan Varga <vargaz@gmail.com>
Thu, 27 Jun 2013 13:35:26 +0000 (15:35 +0200)
committerZoltan Varga <vargaz@gmail.com>
Thu, 27 Jun 2013 13:36:01 +0000 (15:36 +0200)
configure.in

index d1d33cad48980305530b7446ae80fdad819590c2..e1bb5489de56cc665993b765896022d041a4fb1f 100644 (file)
@@ -499,6 +499,20 @@ AC_CHECK_HEADERS(linux/magic.h)
 # not 64 bit clean in cross-compile
 AC_CHECK_SIZEOF(void *, 4)
 
+AC_CACHE_CHECK([for clang],
+       mono_cv_clang,[
+       AC_TRY_COMPILE([], [
+               #ifdef __clang__
+               #else
+               #error "FAILED"
+               #endif
+               return 0;
+       ],
+       [mono_cv_clang=yes],
+       [mono_cv_clang=no],
+       [])
+])
+
 WARN=''
 if test x"$GCC" = xyes; then
         WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value'
@@ -530,6 +544,12 @@ if test x"$GCC" = xyes; then
                   AC_MSG_RESULT(no)
                   CFLAGS=$ORIG_CFLAGS
                ])
+
+               if test "x$mono_cv_clang" = "xyes"; then
+                  # https://bugzilla.samba.org/show_bug.cgi?id=8118
+                  WARN="$WARN -Qunused-arguments"
+                  WARN="$WARN -Wno-unused-function -Wno-tautological-compare"
+               fi
 else
        # The Sun Forte compiler complains about inline functions that access static variables
        # so disable all inlining.
@@ -542,20 +562,6 @@ fi
 CFLAGS="$CFLAGS -g $WARN"
 CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -g"
 
-AC_CACHE_CHECK([for clang],
-       mono_cv_clang,[
-       AC_TRY_COMPILE([], [
-               #ifdef __clang__
-               #else
-               #error "FAILED"
-               #endif
-               return 0;
-       ],
-       [mono_cv_clang=yes],
-       [mono_cv_clang=no],
-       [])
-])
-
 # Where's the 'mcs' source tree?
 if test -d $srcdir/mcs; then
   mcsdir=mcs