]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Adjust CFLAGS and CXXFLAGS for compilation with clang. The current
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 4 Oct 2013 21:12:17 +0000 (21:12 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 4 Oct 2013 21:12:17 +0000 (21:12 +0000)
setting suppresses almost all warnings originating in source code
constructs. It does ot yet suppress warnings from unrecognised command
line flags as they may be the reason for regression test failures
which have not yet been investigated.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13619

Makefile.tool-tests.am
configure.ac

index c8fd434fca35006732261cfb024f8cd6f7e0eaad..299ba7b38177b670fc0076fd3682243d2ac2398d 100644 (file)
@@ -31,6 +31,13 @@ if HAS_WRITE_STRINGS_WARNING
 CFLAGS += -Wno-write-strings
 endif
 
+if COMPILER_IS_CLANG
+CFLAGS   += -Wno-format-extra-args       # perf/tinycc.c
+CFLAGS   += -Wno-literal-range           # none/tests/amd64/fxtract.c
+CFLAGS   += -Wno-string-plus-int         # drd/tests/annotate_ignore_rw.c
+CXXFLAGS += -Wno-unused-private-field    # drd/tests/tsan_unittest.cpp
+endif
+
 check-local: build-noinst_DSYMS
 
 clean-local: clean-noinst_DSYMS
index 6fc3f1d4f6cfbfc2ec32b9364517de4b3f6b9cb7..42f2ac5ce64ee1b78c423ed756b5aa95613949bd 100644 (file)
@@ -119,6 +119,8 @@ if test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xcla
     is_clang="clang"
     # Don't use -dumpversion with clang: it will always produce "4.2.1".
     gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'`
+    CFLAGS="$CFLAGS -Wno-tautological-compare -Wno-cast-align -Wno-self-assign"
+    CXXFLAGS="$CXXFLAGS -Wno-tautological-compare -Wno-cast-align -Wno-self-assign"
 else
     is_clang="notclang"
     gcc_version=`${CC} -dumpversion 2>/dev/null`
@@ -127,6 +129,7 @@ else
     fi
 fi
 ]
+AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang)
 
 case "${is_clang}-${gcc_version}" in
      notclang-3.*)