]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use AC_GCC_WARNING_COND to figure out whether the compiler
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 24 Oct 2014 07:42:19 +0000 (07:42 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 24 Oct 2014 07:42:19 +0000 (07:42 +0000)
supports -Wcast-qual.

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

configure.ac

index 4b3edd0dd4ff030ebb36af00550a61c7df9eecf9..06b9709329ebeaea4806ec4fb7c262696d732908 100644 (file)
@@ -1736,25 +1736,8 @@ AC_MSG_RESULT([-Wextra])
 CFLAGS=$safe_CFLAGS
 
 # does this compiler support -Wcast-qual ?
-AC_MSG_CHECKING([if gcc accepts -Wcast-qual])
-
-safe_CFLAGS=$CFLAGS
-CFLAGS="-Wcast-qual"
-
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
-  return 0;
-]])], [
-cast_qual=yes
-AC_MSG_RESULT([yes])
-], [
-cast_qual=no
-AC_MSG_RESULT([no])
-])
-CFLAGS=$safe_CFLAGS
-
-AM_CONDITIONAL(HAS_CAST_QUAL_WARNING, test x$cast_qual = xyes)
-
-if test x$cast_qual = xyes; then
+AC_GCC_WARNING_COND([cast-qual], [HAS_CAST_QUAL_WARNING])
+if test $has_warning_flag = yes; then
   CFLAGS="$CFLAGS -Wcast-qual"
   CXXFLAGS="$CXXFLAGS -Wcast-qual"
 fi