On 2016-11-11 12:23, Jiri Slaby wrote:
> Hi,
> 
> I am trying a new gcc with new warnings enabled:
> 
> make O=../a/gcc7/ CC='gcc-7' V=1 kernel/exit.o
> EXTRA_CFLAGS='-Wimplicit-fallthrough=3'

Note that EXTRA_CFLAGS is a makefile variable read by both kbuild and
tools/build apparently.

> 
> But the build fails when building under tools/:
[...]
> gcc: error: unrecognized command line option ‘-Wimplicit-fallthrough=3’;
> did you mean ‘-Wno-fallthrough’?
> 
> 
> Apparently, CC is not respected for tools/ dir.

Jiri can better explain the behavior of the tools/ Makefiles, but if you
want to use extra flags for kernel compilation, you should be using the
KCFLAGS variable (see Documentation/kbuild/kbuild.txt).

Michal

Reply via email to