mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
build: do not enable c++ warnings on 0 when nullptr is not supported.
* configure.ac (WARN_CXXFLAGS): Enable -Wzero-as-null-pointer-constant only when nullptr is supported..
This commit is contained in:
@@ -70,7 +70,7 @@ if test "$enable_gcc_warnings" = yes; then
|
|||||||
-Wcast-qual -Wformat -Wpointer-arith -Wwrite-strings'
|
-Wcast-qual -Wformat -Wpointer-arith -Wwrite-strings'
|
||||||
warn_c='-Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes
|
warn_c='-Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes
|
||||||
-Wshadow -Wstrict-prototypes'
|
-Wshadow -Wstrict-prototypes'
|
||||||
warn_cxx='-Wnoexcept -Wzero-as-null-pointer-constant'
|
warn_cxx='-Wnoexcept'
|
||||||
AC_LANG_PUSH([C])
|
AC_LANG_PUSH([C])
|
||||||
for i in $warn_common $warn_c;
|
for i in $warn_common $warn_c;
|
||||||
do
|
do
|
||||||
@@ -87,6 +87,8 @@ if test "$enable_gcc_warnings" = yes; then
|
|||||||
do
|
do
|
||||||
gl_WARN_ADD([$i], [WARN_CXXFLAGS])
|
gl_WARN_ADD([$i], [WARN_CXXFLAGS])
|
||||||
done
|
done
|
||||||
|
gl_WARN_ADD([ -Wzero-as-null-pointer-constant], [WARN_CXXFLAGS],
|
||||||
|
[AC_LANG_PROGRAM([], [nullptr])])
|
||||||
gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS])
|
gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS])
|
||||||
# Warnings for the test suite only.
|
# Warnings for the test suite only.
|
||||||
gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
|
gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
|
||||||
|
|||||||
Reference in New Issue
Block a user