Go to file
Masahiro Yamada 64a91907c8 kbuild: refactor scripts/Makefile.extrawarn
Instead of the warning-[123] magic, let's accumulate compiler options
to KBUILD_CFLAGS directly as the top Makefile does. I think this makes
it easier to understand what is going on in this file.

This commit slightly changes the behavior, I think all of which are OK.

[1] Currently, cc-option calls are needlessly evaluated. For example,
      warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
    needs evaluating only when W=3, but it is actually evaluated for
    W=1, W=2 as well. With this commit, only relevant cc-option calls
    will be evaluated. This is a slight optimization.

[2] Currently, unsupported level like W=4 is checked by:
      $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
    This will no longer be checked, but I do not think it is a big
    deal.

[3] Currently, 4 Clang warnings (Winitializer-overrides, Wformat,
    Wsign-compare, Wformat-zero-length) are shown by any of W=1, W=2,
    and W=3. With this commit, they will be warned only by W=1. I
    think this is a more correct behavior since each warning belongs
    to only one group.

For understanding this commit correctly:

We have 3 warning groups, W=1, W=2, and W=3. You may think W=3 has a
higher level than W=1, but they are actually independent. If you like,
you can combine them like W=13. To enable all the warnings, you can
pass W=123. It is shown by 'make help', but not noticed much. Since we
support W= combination, there should not exist intersection among the
three groups. If we enable Winitializer-overrides for W=1, we do not
need to for W=2 or W=3. This is the reason why I think the change [3]
makes sense.

The documentation says -Winitializer-overrides is enabled by default.
(https://clang.llvm.org/docs/DiagnosticsReference.html#winitializer-overrides)
We negate it by passing -Wno-initializer-overrides for the normal
build, but we do not do that for W=1. This means, W=1 effectively
enables -Winitializer-overrides by the clang's default. The same for
the other three.

Add comments in case people are confused with the code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2019-09-06 23:46:52 +09:00
arch kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) 2019-09-04 23:12:50 +09:00
block
certs
crypto
Documentation kbuild: remove ARCH_{CPP,A,C}FLAGS 2019-09-04 10:01:17 +09:00
drivers kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) 2019-09-04 23:12:50 +09:00
fs dax fixes v5.3-rc4 2019-08-11 13:15:10 -07:00
include Kbuild: Handle PREEMPT_RT for version string and magic 2019-08-14 01:10:42 +09:00
init kbuild,arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC 2019-09-04 10:01:17 +09:00
ipc
kernel kbuild: add $(BASH) to run scripts with bash-extension 2019-09-04 22:54:13 +09:00
lib
LICENSES
mm mm/memremap: Fix reuse of pgmap instances with internal references 2019-08-09 14:16:15 -07:00
net
samples
scripts kbuild: refactor scripts/Makefile.extrawarn 2019-09-06 23:46:52 +09:00
security
sound sound fixes for 5.3-rc4 2019-08-09 09:21:27 -07:00
tools Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-08-10 16:19:02 -07:00
usr kbuild: remove clean-dirs syntax 2019-08-29 23:54:29 +09:00
virt KVM/arm fixes for 5.3, take #2 2019-08-09 16:53:50 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore .gitignore: ignore modules.order explicitly 2019-08-22 01:14:11 +09:00
.mailmap
COPYING
CREDITS
Kbuild kbuild: do not descend to ./Kbuild when cleaning 2019-08-21 21:03:58 +09:00
Kconfig
MAINTAINERS Char/misc fixes for 5.3-rc4 2019-08-10 12:24:20 -07:00
Makefile kbuild: add $(BASH) to run scripts with bash-extension 2019-09-04 22:54:13 +09:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.