Re: [PATCH v2] Makefile: enable -Werror=implicit-int and -Werror=strict-prototypes by default

Sergei Trofimovich
2013-08-23T17:41:14Z

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

On Fri, 23 Aug 2013 14:18:02 +0200
Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> On Thu, Aug 15, 2013 at 8:37 PM, Sergei Trofimovich <slyfox@gentoo.org> wrote:
> > diff --git a/Makefile b/Makefile
> > index 6e48848..53f4776 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -374,6 +374,11 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> > -Werror-implicit-function-declaration \
> > -Wno-format-security \
> > -fno-delete-null-pointer-checks
> > +
> > +# not universally available, but nice to have ones
> > +KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int) \
> > + $(call cc-option,-Werror=strict-prototypes)
> > +
>
> This should be _below_ the line
>
> include $(srctree)/arch/$(SRCARCH)/Makefile
>
> , together with the other users of cc-option, else it detects the features of
> the host compiler instead of the cross-compiler when cross-compiling:
>
> cc1: error: unrecognized command line option "-Werror=implicit-int"
> cc1: error: unrecognized command line option "-Werror=strict-prototypes"

Oh, it was not obvious.

Does it mean the code right before is buggy as well?

> ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> KBUILD_CFLAGS<->+= -Os $(call cc-disable-warning,maybe-uninitialized,)
^^^
> else
> KBUILD_CFLAGS<->+= -O2
> endif

include $(srctree)/arch/$(SRCARCH)/Makefile

Will respin fixed patch in a while.

Thanks!

--

Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]