From: Stratos Psomadakis <psomas@ece.ntua.gr>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>,
linux-kbuild <linux-kbuild@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Borislav Petkov <bp@alien8.de>
Subject: Re: [RFC PATCH] kbuild: implement several W= levels
Date: Fri, 22 Apr 2011 01:06:31 +0300 [thread overview]
Message-ID: <4DB0AA67.6030101@ece.ntua.gr> (raw)
In-Reply-To: <20110421213903.GB9660@merkur.ravnborg.org>
On 22/04/2011 12:39 πμ, Sam Ravnborg wrote:
> Building a kernel with "make W=1" produce far too much noise
> to be usefull.
>
> Divide the warning options in three groups:
>
> W=1 - usefull warning options
> W=2 - noisy but semi usefull warnign options
> W=3 - almost pure noise options
>
> I do not feel strongly about the distinction between
> group 2 and 3. But we should consider what we add in group 1.
>
>
> Sample run on my box (x86, 32bit allyesconfig build)
> CC kernel/bounds.s
> kernel/bounds.c:14: warning: no previous prototype for ‘foo’
> GEN include/generated/bounds.h
> CC arch/x86/kernel/asm-offsets.s
> In file included from include/linux/sched.h:73,
> from arch/x86/kernel/asm-offsets.c:9:
> include/linux/signal.h: In function ‘sigorsets’:
> include/linux/signal.h:121: warning: nested extern declaration of ‘_NSIG_WORDS_is_unsupported_size’
> include/linux/signal.h: In function ‘sigandsets’:
> include/linux/signal.h:124: warning: nested extern declaration of ‘_NSIG_WORDS_is_unsupported_size’
> include/linux/signal.h: In function ‘signandsets’:
> include/linux/signal.h:127: warning: nested extern declaration of ‘_NSIG_WORDS_is_unsupported_size’
> include/linux/signal.h: In function ‘signotset’:
> include/linux/signal.h:151: warning: nested extern declaration of ‘_NSIG_WORDS_is_unsupported_size’
> arch/x86/kernel/asm-offsets.c: At top level:
> arch/x86/kernel/asm-offsets.c:30: warning: no previous prototype for ‘common’
>
> the patch is only an RFC - and is not made on top
> of an upstream kernel with no additiona stuff applied.
>
> Sam
>
> diff --git a/Makefile b/Makefile
> index b967b96..f0e138b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -103,7 +103,7 @@ ifeq ("$(origin O)", "command line")
> endif
>
> ifeq ("$(origin W)", "command line")
> - export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1
> + export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
> endif
>
> # That's our default target when none is given on the command line
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index d5f925a..b65f820 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -56,31 +56,43 @@ endif
> # $(call cc-option... ) handles gcc -W.. options which
> # are not supported by all versions of the compiler
> ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
> -KBUILD_EXTRA_WARNINGS := -Wextra
> -KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter
> -KBUILD_EXTRA_WARNINGS += -Waggregate-return
> -KBUILD_EXTRA_WARNINGS += -Wbad-function-cast
> -KBUILD_EXTRA_WARNINGS += -Wcast-qual
> -KBUILD_EXTRA_WARNINGS += -Wcast-align
> -KBUILD_EXTRA_WARNINGS += -Wconversion
> -KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization
> -KBUILD_EXTRA_WARNINGS += -Wlogical-op
> -KBUILD_EXTRA_WARNINGS += -Wmissing-declarations
> -KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute
> -KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,)
> -KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes
> -KBUILD_EXTRA_WARNINGS += -Wnested-externs
> -KBUILD_EXTRA_WARNINGS += -Wold-style-definition
> -KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,)
> -KBUILD_EXTRA_WARNINGS += -Wpacked
> -KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat
> -KBUILD_EXTRA_WARNINGS += -Wpadded
> -KBUILD_EXTRA_WARNINGS += -Wpointer-arith
> -KBUILD_EXTRA_WARNINGS += -Wredundant-decls
> -KBUILD_EXTRA_WARNINGS += -Wshadow
> -KBUILD_EXTRA_WARNINGS += -Wswitch-default
> -KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,)
> -KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS)
> +warning-1 := -Wextra
> +warning-1 += -Wunused -Wno-unused-parameter
> +warning-2 += -Waggregate-return
> +warning-2 += -Wbad-function-cast
> +warning-2 += -Wcast-qual
> +warning-2 += -Wcast-align
> +warning-3 += -Wconversion
> +warning-2 += -Wdisabled-optimization
> +warning-2 += -Wlogical-op
> +warning-1 += -Wmissing-declarations
> +warning-1 += -Wmissing-format-attribute
> +warning-1 += $(call cc-option, -Wmissing-include-dirs,)
> +warning-1 += -Wmissing-prototypes
> +warning-1 += -Wnested-externs
> +warning-2 += -Wold-style-definition
> +warning-2 += $(call cc-option, -Woverlength-strings,)
> +warning-3 += -Wpacked
> +warning-3 += -Wpacked-bitfield-compat
> +warning-3 += -Wpadded
> +warning-3 += -Wpointer-arith
> +warning-2 += -Wredundant-decls
> +warning-2 += -Wshadow
> +warning-3 += -Wswitch-default
> +warning-3 += $(call cc-option, -Wvla,)
> +ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),1)
> + KBUILD_CFLAGS += $(warning-1)
> +else
> + ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),2)
> + KBUILD_CFLAGS += $(warning-1) $(warning-2)
> + else
> + ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),3)
> + KBUILD_CFLAGS += $(warning-1) $(warning-2) $(warning-3)
> + else
> + $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
> + endif
> + endif
> +endif
> endif
>
> include scripts/Makefile.lib
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
Just started looking at the patch.
I tested it and -Wnested-externs is causing a *lot* of noise, because of
the nested extern ‘_NSIG_WORDS_is_unsupported_size’ in
include/linux/signal.h, which gets included a lot.
So, unless that changes, I think that it shouldn't be enabled for W=1.
--
Stratos Psomadakis
<psomas@ece.ntua.gr>
next prev parent reply other threads:[~2011-04-21 22:53 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-21 21:39 [RFC PATCH] kbuild: implement several W= levels Sam Ravnborg
2011-04-21 21:58 ` Joe Perches
2011-04-21 22:56 ` Stratos Psomadakis
2011-04-21 22:06 ` Stratos Psomadakis [this message]
2011-04-22 1:28 ` Sam Ravnborg
2011-04-22 7:38 ` [RFC PATCH v2] " Sam Ravnborg
2011-04-22 7:38 ` 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-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
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=4DB0AA67.6030101@ece.ntua.gr \
--to=psomas@ece.ntua.gr \
--cc=bp@alien8.de \
--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 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.