All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: mengdong.lin@linux.intel.com, alsa-devel@alsa-project.org
Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com, mengdong.lin@intel.com
Subject: Re: [PATCH 1/2] ucm: Enable all warnings for automake C preprocessor
Date: Wed, 28 Dec 2016 21:22:12 +0900	[thread overview]
Message-ID: <2eb6c9c3-a32a-40ee-544a-50eb03257e5b@sakamocchi.jp> (raw)
In-Reply-To: <1482833331-2261-1-git-send-email-mengdong.lin@linux.intel.com>

Hi,

On Dec 27 2016 19:08, mengdong.lin@linux.intel.com wrote:
> From: Mengdong Lin <mengdong.lin@linux.intel.com>
>
> To display warnings for us to fix them, add '-Wall' to AM_CPPFLAGS.
>
> Signed-off-by: Mengdong Lin <mengdong.lin@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

As long as I know, the '-Wall' option is for C/C++ compiler. Therefore, 
it's not necessarily correct to add the option to 'AM_CPPFLAGS' as 
options for preprocessor. In a manual of GNU Automake, there're some 
samples for this option; '-I' and '-D'[0]. Usage of 'AM_CFLAGS' might be 
better in this case.

...But this indication is a bit nitpicking and I'm not so strongly 
oppose this patch. I'll manage to describe the reason.

In a manual of GNU compiler collection, there're samples of implicit 
rules for C/C++ compilers:
  * $(CC) $(CPPFLAGS) $(CFLAGS) -c
  * $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c

If the place of 'CPPFLAGS' is replaced with options in AM_CPPFLAGS, your 
patch has an effect for both of C code and C++ code. This is somehow 
expected for some developers, while it's also be obtrusive because of 
sub-effect to C++ code in our case.

Currently, alsa-lib includes no C++ codes, while this patch could bring 
the obtrusiveness for future when some C++ codes were added (i.e. by 
code refactoring). But the result were preferable by itself, I believe.

Well, if Makefile.am includes 'mumble_CFLAGS' lines, options in 
'AM_CFLAGS' is ignored to generate the 'mumble'. For example, a command 
to generate 'user_ctl_element_set' object in 'test' directory is this 
case (I wrote it[2]).

Currently I cannot judge which way is better... I'm sorry but could I 
request your opinion for this patch with the view of these specifications?

[0]: 
https://www.gnu.org/software/automake/manual/html_node/Program-Variables.html
[1]: 
https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#Catalogue-of-Rules
[2]: 
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=test/Makefile.am;h=5f35159af2d64c12e5d394cff884765808d38e5b;hb=HEAD#l29


Regards

Takashi Sakamoto

  reply	other threads:[~2016-12-28 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-27 10:08 [PATCH 1/2] ucm: Enable all warnings for automake C preprocessor mengdong.lin
2016-12-28 12:22 ` Takashi Sakamoto [this message]
2016-12-28 15:23 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2eb6c9c3-a32a-40ee-544a-50eb03257e5b@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=mengdong.lin@intel.com \
    --cc=mengdong.lin@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.