]> git.saurik.com Git - bison.git/commitdiff
build: do not enable c++ warnings on 0 when nullptr is not supported.
authorAkim Demaille <akim@lrde.epita.fr>
Wed, 9 May 2012 09:20:18 +0000 (11:20 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Fri, 11 May 2012 07:26:09 +0000 (09:26 +0200)
* configure.ac (WARN_CXXFLAGS): Enable -Wzero-as-null-pointer-constant
only when nullptr is supported..

configure.ac

index 9395568563a7be292a909667b978b61747f46db8..6a75d7b414e2b70c0f384288231dd9a85e09511e 100644 (file)
@@ -70,7 +70,7 @@ if test "$enable_gcc_warnings" = yes; then
     -Wcast-qual -Wformat -Wpointer-arith -Wwrite-strings'
   warn_c='-Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes
     -Wshadow -Wstrict-prototypes'
-  warn_cxx='-Wnoexcept -Wzero-as-null-pointer-constant'
+  warn_cxx='-Wnoexcept'
   AC_LANG_PUSH([C])
   for i in $warn_common $warn_c;
   do
@@ -87,6 +87,8 @@ if test "$enable_gcc_warnings" = yes; then
   do
     gl_WARN_ADD([$i], [WARN_CXXFLAGS])
   done
+  gl_WARN_ADD([ -Wzero-as-null-pointer-constant], [WARN_CXXFLAGS],
+              [AC_LANG_PROGRAM([], [nullptr])])
   gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS])
   # Warnings for the test suite only.
   gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])