configure: simplify warning flags detection
We currently use the AX_COMPILER_FLAGS macro to detect the warning flags
that the current compiler supports. It works, but is quite invasive.
It unconditionally enables a bunch of warnings we don't want, which
forces us to disable them with many -Wno-foo switches.
Instead of using AX_COMPILER_FLAGS, we can use the slightly lower lever
macro AX_APPEND_COMPILE_FLAGS to achieve our goal of detecting which
warning flags are supported. This is what we ended up using in
lttng-tools (a completely unrelated project, but that has a suspiciously
high ratio of contributors in common with Babeltrace).
I looked in our git history to see which warning flags were mentioned in
commit messages. I have added the flags that did find actual problems
and are not enabled by default to the AX_APPEND_COMPILE_FLAGS invocation.
I have also added the flags that AX_COMPILER_FLAGS did provide, which we
didn't need to disable.
The --{enable,disable}-Werror flag is added using an explicit
AC_ARG_ENABLE. In lttng-tools, it was decided to _not_ have -Werror by
default, so I suggest we do the same in Babeltrace, for consistency
(although it saddens me very much). Developers who want to build with
-Werror will need to pass --enable-Werror.
Note that with this patch, we lose the following configure switch, that
is provided by AX_COMPILER_FLAGS:
--enable-compile-warnings=[no/yes/error]
Change-Id: If968f7385a7f5c48d27f402c76bc26241a8f505a
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3209
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
This page took 0.025747 seconds and 4 git commands to generate.