Maciej Żenczykowski
2012-Jun-28 01:13 UTC
[klibc] [PATCH] klibc: introduce EXTRA_KLIBCWARNFLAGS variable
From: Maciej ?enczykowski <maze at google.com> Introduce new EXTRA_KLIBCWARNFLAGS variable which is appended to the compiler warning flags. This can be used to enable compiler warning promotion with: make EXTRA_KLIBCWARNFLAGS=-Werror (and/or to disable individual warnings) Signed-off-by: Maciej ?enczykowski <maze at google.com> --- scripts/Kbuild.klibc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc index f500d5358ef6..e913c5c9a4a9 100644 --- a/scripts/Kbuild.klibc +++ b/scripts/Kbuild.klibc @@ -70,7 +70,8 @@ KLIBCREQFLAGS := $(call cc-option, -fno-stack-protector, ) \ $(call cc-option, -fwrapv, ) KLIBCARCHREQFLAGS : KLIBCOPTFLAGS :-KLIBCWARNFLAGS := -W -Wall -Wno-sign-compare -Wno-unused-parameter +KLIBCWARNFLAGS := -W -Wall -Wno-sign-compare -Wno-unused-parameter \ + $(EXTRA_KLIBCWARNFLAGS) KLIBCSHAREDFLAGS : KLIBCBITSIZE : KLIBCLDFLAGS :-- 1.7.9.4
maximilian attems
2012-Jun-28 15:30 UTC
[klibc] [PATCH] klibc: introduce EXTRA_KLIBCWARNFLAGS variable
On Wed, 27 Jun 2012, Maciej ?enczykowski wrote:> From: Maciej ?enczykowski <maze at google.com> > > Introduce new EXTRA_KLIBCWARNFLAGS variable which is appended to > the compiler warning flags. > > This can be used to enable compiler warning promotion with: > make EXTRA_KLIBCWARNFLAGS=-Werror > (and/or to disable individual warnings) > > Signed-off-by: Maciej ?enczykowski <maze at google.com> > --- > scripts/Kbuild.klibc | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-)Looks good to me, waiting on Sam to eyeball and ack/nack it?> diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc > index f500d5358ef6..e913c5c9a4a9 100644 > --- a/scripts/Kbuild.klibc > +++ b/scripts/Kbuild.klibc > @@ -70,7 +70,8 @@ KLIBCREQFLAGS := $(call cc-option, -fno-stack-protector, ) \ > $(call cc-option, -fwrapv, ) > KLIBCARCHREQFLAGS :> KLIBCOPTFLAGS :> -KLIBCWARNFLAGS := -W -Wall -Wno-sign-compare -Wno-unused-parameter > +KLIBCWARNFLAGS := -W -Wall -Wno-sign-compare -Wno-unused-parameter \ > + $(EXTRA_KLIBCWARNFLAGS) > KLIBCSHAREDFLAGS :> KLIBCBITSIZE :> KLIBCLDFLAGS :> -- > 1.7.9.4 > > _______________________________________________ > klibc mailing list > klibc at zytor.com > http://www.zytor.com/mailman/listinfo/klibc-- maks
Sam Ravnborg
2012-Jun-28 17:07 UTC
[klibc] [PATCH] klibc: introduce EXTRA_KLIBCWARNFLAGS variable
On Thu, Jun 28, 2012 at 05:30:42PM +0200, maximilian attems wrote:> On Wed, 27 Jun 2012, Maciej ?enczykowski wrote: > > > From: Maciej ?enczykowski <maze at google.com> > > > > Introduce new EXTRA_KLIBCWARNFLAGS variable which is appended to > > the compiler warning flags. > > > > This can be used to enable compiler warning promotion with: > > make EXTRA_KLIBCWARNFLAGS=-Werror > > (and/or to disable individual warnings) > > > > Signed-off-by: Maciej ?enczykowski <maze at google.com> > > --- > > scripts/Kbuild.klibc | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > Looks good to me, waiting on Sam to eyeball and ack/nack it?The kbuild way to deal with this on a directory base is to use: ccflags-y := -Werror IMO this approach is better because: 1) We can pass any options to cc - we are not restricted to warning related options 2) lower-case signals that this is not globel - but local for this directory 3) The "-y" part allows you to say ccflags-$(CONFIG_FOO) := -DFOO 4) It is aligned with kbuild I am obviously a bit biased here as I do not see much other build systems than kbuild.... Sam
Maciej Żenczykowski
2012-Jun-28 19:23 UTC
[klibc] [PATCH] klibc: introduce EXTRA_KLIBCWARNFLAGS variable
Awesome, but how do you pass that in from the command line? or are you talking about a purely hypothetical scenario? On Thu, Jun 28, 2012 at 10:07 AM, Sam Ravnborg <sam at ravnborg.org> wrote:> On Thu, Jun 28, 2012 at 05:30:42PM +0200, maximilian attems wrote: >> On Wed, 27 Jun 2012, Maciej ?enczykowski wrote: >> >> > From: Maciej ?enczykowski <maze at google.com> >> > >> > Introduce new EXTRA_KLIBCWARNFLAGS variable which is appended to >> > the compiler warning flags. >> > >> > This can be used to enable compiler warning promotion with: >> > ? make EXTRA_KLIBCWARNFLAGS=-Werror >> > (and/or to disable individual warnings) >> > >> > Signed-off-by: Maciej ?enczykowski <maze at google.com> >> > --- >> > ?scripts/Kbuild.klibc | ? ?3 ++- >> > ?1 file changed, 2 insertions(+), 1 deletion(-) >> >> Looks good to me, waiting on Sam to eyeball and ack/nack it? > > The kbuild way to deal with this on a directory base is to use: > > ? ?ccflags-y := -Werror > > IMO this approach is better because: > 1) We can pass any options to cc - we are not restricted to warning related options > 2) lower-case signals that this is not globel - but local for this directory > 3) The "-y" part allows you to say ccflags-$(CONFIG_FOO) := -DFOO > 4) It is aligned with kbuild > > I am obviously a bit biased here as I do not see much other build systems > than kbuild.... > > ? ? ? ?Sam >-- Maciej A. ?enczykowski Kernel Networking Developer @ Google 1600 Amphitheatre Parkway, Mountain View, CA 94043 tel: +1 (650) 253-0062
Sam Ravnborg
2012-Jun-28 19:35 UTC
[klibc] [PATCH] klibc: introduce EXTRA_KLIBCWARNFLAGS variable
On Thu, Jun 28, 2012 at 12:23:45PM -0700, Maciej ?enczykowski wrote:> Awesome, but how do you pass that in from the command line? > or are you talking about a purely hypothetical scenario?As this was in kbuild.klibc I assumed this was for use in kbuild files. Also in kbuild EXTRA_... is for use in kbuild files. For the command-line in kbuild KCFLAGS=... is used. Again - keeping in sync with kernel kbuild would be good. Sam
maximilian attems
2012-Jul-02 08:36 UTC
[klibc] [PATCH] klibc: introduce EXTRA_KLIBCWARNFLAGS variable
On Thu, Jun 28, 2012 at 09:35:13PM +0200, Sam Ravnborg wrote:> On Thu, Jun 28, 2012 at 12:23:45PM -0700, Maciej ?enczykowski wrote: > > Awesome, but how do you pass that in from the command line? > > or are you talking about a purely hypothetical scenario? > > As this was in kbuild.klibc I assumed this was for use > in kbuild files. > Also in kbuild EXTRA_... is for use in kbuild files. > > For the command-line in kbuild KCFLAGS=... is used. > Again - keeping in sync with kernel kbuild would be good.Care to respin based on the feedback? thanks. -- maks