Re: [PATCH v2] mips: Add '-std=gnu11' to vdso CFLAGS

From: Thomas Bogendoerfer
Date: Sat Mar 29 2025 - 05:57:44 EST


On Wed, Mar 26, 2025 at 08:24:36PM -0700, Khem Raj wrote:
> GCC 15 changed the default C standard dialect from gnu17 to gnu23,
> which should not have impacted the kernel because it explicitly requests
> the gnu11 standard in the main Makefile. However, mips/vdso code uses
> its own CFLAGS without a '-std=' value, which break with this dialect
> change because of the kernel's own definitions of bool, false, and true
> conflicting with the C23 reserved keywords.
>
> include/linux/stddef.h:11:9: error: cannot use keyword 'false' as enumeration constant
> 11 | false = 0,
> | ^~~~~
> include/linux/stddef.h:11:9: note: 'false' is a keyword with '-std=c23' onwards
> include/linux/types.h:35:33: error: 'bool' cannot be defined via 'typedef'
> 35 | typedef _Bool bool;
> | ^~~~
> include/linux/types.h:35:33: note: 'bool' is a keyword with '-std=c23' onwards
>
> Add '-std=gnu11' to the decompressor and purgatory CFLAGS to eliminate
> these errors and make the C standard version of these areas match the
> rest of the kernel.

please adapt subject and description.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]