From: Akim Demaille Date: Wed, 30 Jan 2013 14:28:08 +0000 (+0100) Subject: build: please Clang++ 3.2+ on Flex scanners X-Git-Tag: v2.7.90~126 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/1217688141e33e03112330a24ff352d9263ef7bc build: please Clang++ 3.2+ on Flex scanners Clang++, with -Wall, rejects code generated by Flex (for C scanners): CXX examples/calc++/examples_calc___calc__-calc++-scanner.o In file included from examples/calc++/calc++-scanner.cc:1: error: implicit conversion of NULL constant to 'bool' [-Werror,-Wnull-conversion] if ( ! ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : __null) ) { ~ ^~~~~~ false * configure.ac (WARN_NO_NULL_CONVERSION_CXXFLAGS): Compute it. * examples/calc++/local.mk (examples_calc___calc___CXXFLAGS): Use it. --- diff --git a/configure.ac b/configure.ac index 76a0ecf9..289b2995 100644 --- a/configure.ac +++ b/configure.ac @@ -133,6 +133,8 @@ if test "$enable_gcc_warnings" = yes; then # Warnings for the test suite only. gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST]) gl_WARN_ADD([-pedantic], [WARN_CXXFLAGS_TEST]) + # Clang++ 3.2+ reject C code generated by Flex. + gl_WARN_ADD([-Wno-null-conversion], [WARN_NO_NULL_CONVERSION_CXXFLAGS]) # Variants break strict aliasing analysis. gl_WARN_ADD([-fno-strict-aliasing], [NO_STRICT_ALIAS_CXXFLAGS]) CXXFLAGS=$save_CXXFLAGS diff --git a/examples/calc++/local.mk b/examples/calc++/local.mk index c0cb5e81..6eb31f89 100644 --- a/examples/calc++/local.mk +++ b/examples/calc++/local.mk @@ -69,5 +69,7 @@ nodist_examples_calc___calc___SOURCES = \ $(calc_sources) examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++ +examples_calc___calc___CXXFLAGS = \ + $(AM_CXXFLAGS) $(WARN_NO_NULL_CONVERSION_CXXFLAGS) dist_TESTS += examples/calc++/calc++.test endif