]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added configure tests for the compiler flags -Wno-nonnull and -Wno-overflow.
authorBart Van Assche <bvanassche@acm.org>
Sun, 15 May 2011 17:05:36 +0000 (17:05 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 15 May 2011 17:05:36 +0000 (17:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11757

configure.in

index f3fe57523105dccbfeedb25c9dde4ae8ac781405..e95b4d7cb61530fbb5ee4bd9033040e92453ccba 100644 (file)
@@ -1282,6 +1282,52 @@ AC_MSG_RESULT([no])
 CFLAGS=$safe_CFLAGS
 
 
+# does this compiler support -Wno-nonnull ?
+
+AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wno-nonnull"
+
+AC_TRY_COMPILE(
+[ ],
+[
+  return 0;
+],
+[
+AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
+AC_MSG_RESULT([yes])
+],
+[
+AC_SUBST([FLAG_W_NO_NONNULL], [])
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+
+# does this compiler support -Wno-overflow ?
+
+AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
+
+safe_CFLAGS=$CFLAGS
+CFLAGS="-Wno-overflow"
+
+AC_TRY_COMPILE(
+[ ],
+[
+  return 0;
+],
+[
+AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
+AC_MSG_RESULT([yes])
+],
+[
+AC_SUBST([FLAG_W_NO_OVERFLOW], [])
+AC_MSG_RESULT([no])
+])
+CFLAGS=$safe_CFLAGS
+
+
 # does this compiler support -Wno-uninitialized ?
 
 AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])