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.
# 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
$(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