[alsa-devel] [PATCH 1/2] ucm: Enable all warnings for automake C preprocessor

Takashi Iwai tiwai at suse.de
Wed Dec 28 16:23:22 CET 2016


On Tue, 27 Dec 2016 11:08:51 +0100,
mengdong.lin at linux.intel.com wrote:
> 
> From: Mengdong Lin <mengdong.lin at linux.intel.com>
> 
> To display warnings for us to fix them, add '-Wall' to AM_CPPFLAGS.

As Sakamoto-san already pointed, AM_CPPFLAGS is no correct variable to
set such a flag.

And, yet, an open question is whether we should add this
unconditionally or not.  In general, -W is a compiler-specific option,
and it's not always available.  That's why we didn't set it usually,
but leaving it in extra $CFLAGS pass mechanism at the invocation time,
as found in gitcompile script.

Of course, all gcc versions have -W options, but a 3rd party compiler
might not.  We may cover via autoconf, but it'll be messy too.  So, if
we really want to be safe, we shouldn't set it in Makefile.am but
leave user decide.

OTOH, -Wall is set in some subdirectories, and it's fine in 99.999%
cases.  We can add it mostly safely.

That said, I'm not quite sure (or don't care much) about this.  But if
we add -Wall, it'd be better to handle it in the top level, instead of
each subdirectory.


thanks,

Takashi

> 
> Signed-off-by: Mengdong Lin <mengdong.lin at linux.intel.com>
> 
> diff --git a/src/ucm/Makefile.am b/src/ucm/Makefile.am
> index 9d66b24..79e57d2 100644
> --- a/src/ucm/Makefile.am
> +++ b/src/ucm/Makefile.am
> @@ -7,4 +7,4 @@ noinst_HEADERS = ucm_local.h
>  all: libucm.la
>  
>  
> -AM_CPPFLAGS=-I$(top_srcdir)/include
> +AM_CPPFLAGS=-I$(top_srcdir)/include -Wall
> -- 
> 2.7.4
> 


More information about the Alsa-devel mailing list