From: Arnaud Lacombe <lacombar@gmail.com>
To: Michal Marek <mmarek@suse.cz>
Cc: Valdis.Kletnieks@vt.edu, bp@alien8.de, sam@ravnborg.org,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
davej@redhat.com
Subject: Re: [PATCH] kbuild: Allow to combine multiple W= levels
Date: Fri, 29 Apr 2011 14:13:11 -0400 [thread overview]
Message-ID: <BANLkTimsNF=OeaLSnSt2gFdDaAbJ6tMFng@mail.gmail.com> (raw)
In-Reply-To: <1304083893-18849-1-git-send-email-mmarek@suse.cz>
Hi,
On Fri, Apr 29, 2011 at 9:31 AM, Michal Marek <mmarek@suse.cz> wrote:
> Add support for make W=12, make W=123 and so on, to enable warnings from
> multiple W= levels. Normally, make W=<level> does not include warnings
> from the previous level.
>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
> scripts/Makefile.build | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 9c0c481..28cef2a 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -60,6 +60,8 @@ endif
> # $(call cc-option, -W...) handles gcc -W.. options which
> # are not supported by all versions of the compiler
> ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
> +warning- := $(empty)
> +
> warning-1 := -Wextra -Wunused -Wno-unused-parameter
> warning-1 += -Wmissing-declarations
> warning-1 += -Wmissing-format-attribute
> @@ -85,9 +87,11 @@ warning-3 += -Wswitch-default
> warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
> warning-3 += $(call cc-option, -Wvla)
>
> -warning := $(warning-$(KBUILD_ENABLE_EXTRA_GCC_CHECKS))
> +warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
> +warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
> +warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
>
I do not really like that, it would mean that W=123, W=321, W=231 and
W=132 would lead to the same result. What about a comma separated
string, ala:
LEVELS=1,2,3,4
comma:= ,
empty:=
space:= $(empty) $(empty)
warning-1:= a
warning-2:= b
warning-3:= c
warning-4:= d
all:
echo $(foreach level, $(subst ${comma},${space},${LEVELS},
${warning}), ${warning-${level}})
It has the advantage to scale up without adding new code.
- Arnaud
> -ifeq ("$(warning)","")
> +ifeq ("$(strip $(warning))","")
> $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
> endif
>
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2011-04-29 18:13 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-21 21:39 [RFC PATCH] kbuild: implement several " Sam Ravnborg
2011-04-21 21:58 ` Joe Perches
2011-04-21 22:56 ` Stratos Psomadakis
2011-04-21 22:06 ` Stratos Psomadakis
2011-04-22 1:28 ` Sam Ravnborg
2011-04-22 7:38 ` [RFC PATCH v2] " Sam Ravnborg
2011-04-22 8:19 ` [RFC PATCH] " Borislav Petkov
2011-04-22 10:15 ` Sam Ravnborg
2011-04-22 10:20 ` Borislav Petkov
2011-04-22 10:46 ` [PATCH v3] " Borislav Petkov
2011-04-22 11:09 ` Sam Ravnborg
2011-04-22 17:50 ` [PATCH v3.1] " Borislav Petkov
2011-04-26 19:52 ` Michal Marek
2011-04-26 20:43 ` Borislav Petkov
2011-04-27 8:22 ` Sam Ravnborg
2011-04-27 8:25 ` Sam Ravnborg
2011-04-27 11:35 ` Borislav Petkov
2011-04-27 20:15 ` [PATCH v3.2] " Borislav Petkov
2011-04-27 20:21 ` Joe Perches
2011-04-27 20:46 ` Sam Ravnborg
2011-04-27 20:46 ` Sam Ravnborg
2011-04-28 16:18 ` Michal Marek
2011-04-28 0:25 ` [PATCH v3.1] " Valdis.Kletnieks
2011-04-28 16:24 ` Michal Marek
2011-04-28 17:59 ` Valdis.Kletnieks
2011-04-29 13:31 ` [PATCH] kbuild: Allow to combine multiple " Michal Marek
2011-04-29 17:43 ` Sam Ravnborg
2011-04-29 18:13 ` Arnaud Lacombe [this message]
2011-04-29 18:27 ` Valdis.Kletnieks
2011-04-29 18:29 ` Valdis.Kletnieks
2011-05-02 15:38 ` Michal Marek
2011-05-02 15:53 ` Arnaud Lacombe
2011-05-02 16:05 ` Michal Marek
2011-05-02 16:17 ` Arnaud Lacombe
2011-05-02 16:16 ` Américo Wang
2011-05-02 17:07 ` Sam Ravnborg
2011-05-02 17:34 ` Arnaud Lacombe
2011-05-02 18:03 ` boris
2011-05-02 18:45 ` Arnaud Lacombe
2011-05-02 18:51 ` boris
2011-05-02 20:35 ` Michal Marek
2011-04-27 8:27 ` [PATCH v3] kbuild: implement several " Geert Uytterhoeven
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='BANLkTimsNF=OeaLSnSt2gFdDaAbJ6tMFng@mail.gmail.com' \
--to=lacombar@gmail.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=bp@alien8.de \
--cc=davej@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=sam@ravnborg.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®