Re: [PATCH] Raise the minimum required gcc version to 4.6

From: Arnd Bergmann
Date: Sat Dec 29 2018 - 16:57:51 EST


On Sat, Dec 29, 2018 at 3:25 PM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:

> On Fri, Aug 24, 2018 at 12:00 AM Joe Perches <joe@xxxxxxxxxxx> wrote:
> > On Thu, 2018-08-23 at 23:52 +0200, Geert Uytterhoeven wrote:
> --- build.log.linux-4.20.0-atari-07795-g835f16c9b68966ff-gcc-4.1.2-20061115-prerelease-Ubuntu-4.1.1-21
> +++ build.log.linux-4.20.0-atari-07767-gc085b9fd60f52a62-gcc-7.3.0-27ubuntu1~18.04
>
> 20 warning regressions:
> + arch/m68k/atari/config.c: warning: ISO C90 forbids variable length
> array âswitchesâ [-Wvla]: => 151:2

Ah, so we still have some of these. The warning was only recently added.

> + arch/m68k/include/asm/cmpxchg.h: warning: value computed is not
> used [-Wunused-value]: => 79:22, 122:3, 137:3

IIRC this can be avoided using a ({ ... }) type expression.

> + arch/m68k/include/asm/raw_io.h: warning: cast to pointer from
> integer of different size [-Wint-to-pointer-cast]: => 20:19, 33:35,
> 26:31, 30:32

The I/O accessors are defined in an unusual way that defeats a lot
of the type checking we normally have. Generally speaking the
memory space operations (readl/ioread32/__raw_readl, ...) should
be inline functions taking a 'const volatile void __iomem *' argument
(non-const for writel), while the I/O space operations should take
an integer port number (16 or 32 bit, depending on how your ISA
or PCI buses work).

Doing that should avoid all the warnings you quote here, but may
introduce warnings about nonportable driver code.

> + arch/m68k/include/asm/string.h: warning: argument 2 null where
> non-null expected [-Wnonnull]: => 72:25

This might be a kernel bug.

> + arch/m68k/kernel/setup_mm.c: warning: #warning Are you building an
> allnoconfig kernel? [-Wcpp]: => 51:2
> + arch/m68k/kernel/setup_mm.c: warning: #warning No CPU/platform
> type selected, your kernel will not work! [-Wcpp]: => 50:2
> + arch/m68k/mvme147/config.c: warning: #warning check me! [-Wcpp]: => 150:2
> + arch/m68k/mvme16x/config.c: warning: #warning check me! [-Wcpp]: => 397:2

I've removed that kind of warning from other architectures.

> + arch/m68k/kernel/signal.c: warning: ISO C90 forbids variable
> length array âbufâ [-Wvla]: => 654:3

You can probably pick the maximum here.

> + drivers/i2c/i2c-core-base.c: warning: âretâ may be used
> uninitialized in this function [-Wmaybe-uninitialized]: => 235:5

This might come from the new CONFIG_NO_AUTO_INLINE.

> + drivers/input/joystick/analog.c: warning: #warning Precise timer
> not defined for this architecture. [-Wcpp]: => 172:2

Maybe add a Kconfig dependency on !M68K?

> + include/linux/dynamic_debug.h: warning: statement will never be
> executed [-Wswitch-unreachable]: => 115:19

No idea.

> + warning: unmet direct dependencies detected for NEED_MULTIPLE_NODES: => N/A
> + warning: unmet direct dependencies detected for SND_SOC_QDSP6: => N/A

Not gcc warnings.

Arnd