11 May, 2016

1 commit

  • gcc-6 started warning by default about variables that are not
    used anywhere and that are marked 'const', generating many
    false positives in an allmodconfig build, e.g.:

    arch/arm/mach-davinci/board-da830-evm.c:282:20: warning: 'da830_evm_emif25_pins' defined but not used [-Wunused-const-variable=]
    arch/arm/plat-omap/dmtimer.c:958:34: warning: 'omap_timer_match' defined but not used [-Wunused-const-variable=]
    drivers/bluetooth/hci_bcm.c:625:39: warning: 'acpi_bcm_default_gpios' defined but not used [-Wunused-const-variable=]
    drivers/char/hw_random/omap-rng.c:92:18: warning: 'reg_map_omap4' defined but not used [-Wunused-const-variable=]
    drivers/devfreq/exynos/exynos5_bus.c:381:32: warning: 'exynos5_busfreq_int_pm' defined but not used [-Wunused-const-variable=]
    drivers/dma/mv_xor.c:1139:34: warning: 'mv_xor_dt_ids' defined but not used [-Wunused-const-variable=]

    This is similar to the existing -Wunused-but-set-variable warning
    that was added in an earlier release and that we disable by default
    now and only enable when W=1 is set, so it makes sense to do
    the same here. Once we have eliminated the majority of the
    warnings for both, we can put them back into the default list.

    We probably want this in backport kernels as well, to allow building
    them with gcc-6 without introducing extra warnings.

    Signed-off-by: Arnd Bergmann
    Acked-by: Olof Johansson
    Acked-by: Lee Jones
    Cc: stable@vger.kernel.org
    Signed-off-by: Michal Marek

    Arnd Bergmann
     

12 Jan, 2016

1 commit

  • Ideally, a kernel compile with W=1 enabled should complete cleanly;
    however, when we run one currently we are presented with ~25k warnings.
    'sign-compare' accounts for ~22k of those ~25k.

    In this patch we're demoting 'sign-compare' warnings to W=2, with a view
    to fixing the remaining 3k W=1 warnings required for a clean build.

    Arnd adds:
    "As per our discussion, I'd add that this was inadvertedly introduced
    by Behan when he moved the clang specific warnings into an ifdef block
    and did not notice that -Wsign-compare was interpreted by both gcc
    and clang.

    Earlier, it was introduced in just the same way by Jan-Simon as part
    of 3d3d6b847420 ("kbuild: LLVMLinux: Adapt warnings for compilation
    with clang")."

    Acked-by: Arnd Bergmann
    Fixes: 26ea6bb1fef0 ("kbuild, LLVMLinux: Supress warnings unless W=1-3")
    Signed-off-by: Lee Jones
    Signed-off-by: Michal Marek

    Lee Jones
     

04 Sep, 2015

1 commit

  • We cannot detect clang before including the arch Makefile, because that
    can set the default cross compiler. We also cannot detect clang after
    including the arch Makefile, because powerpc wants to know about clang.
    Solve this by using an deferred variable. This costs us a few shell
    invocations, but this is only a constant number.

    Reported-by: Behan Webster
    Reported-by: Anton Blanchard
    Signed-off-by: Michal Marek

    Michal Marek
     

05 Aug, 2014

1 commit

  • clang has more warnings enabled by default. Turn them off unless W is
    set. This patch fixes a logic bug where warnings in clang were disabled
    when W was set.

    Signed-off-by: Behan Webster
    Signed-off-by: Jan-Simon Möller
    Signed-off-by: Mark Charlebois
    Cc: bp@alien8.de
    Signed-off-by: Michal Marek

    Behan Webster
     

17 Apr, 2014

1 commit

  • W=... provides extra gcc checks.

    Having such code in scripts/Makefile.build results in the same flags
    being added to KBUILD_CFLAGS multiple times becuase
    scripts/Makefile.build is invoked every time Kbuild descends into
    the subdirectories.

    Since the top Makefile is already too cluttered, this commit moves
    all of extra gcc check stuff to a new file scripts/Makefile.extrawarn,
    which is included from the top Makefile.

    Signed-off-by: Masahiro Yamada
    CC: Sam Ravnborg
    Signed-off-by: Michal Marek

    Masahiro Yamada