configure: use AX_APPEND_COMPILE_FLAGS to detect supported warning flags
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 31 Jan 2020 18:05:20 +0000 (13:05 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 18 Feb 2020 20:31:55 +0000 (15:31 -0500)
I would eventually like to enable some additional warnings by default
when building lttng-tools.  However, some warnings are
compiler-specific or are not present in older versions of some compilers
we need to support.  We can therefore not add them unconditionally to
CFLAGS.

This patch uses the AX_APPEND_COMPILE_FLAGS macro to address that.  This
macro tests each individual flag we pass it with the current compiler.
If it finds that the flag is supported (the compiler exits with status 0
when compiling a file with that flag), it appends it to the given
variable, WARN_CFLAGS in our case).  WARN_CFLAGS is then added to
AM_CFLAGS.

With time, we'll be able to throw any warning flag in there that we
think is useful, even if just available in a recent version of one
compiler.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Id2ae4b4e8882af788c835ce89a979544531370e9
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>

No differences found
This page took 0.024674 seconds and 4 git commands to generate.