mirror of https://github.com/torvalds/linux.git
GCC 15 changed the default C standard version to C23, which should not
have impacted the kernel because it requests the gnu11 standard via
'-std=' in the main Makefile. However, the x86 compressed boot Makefile
uses its own set of KBUILD_CFLAGS without a '-std=' value (i.e., using
the default), resulting in errors from the kernel's definitions of bool,
true, and false in stddef.h, which are reserved keywords under C23.
./include/linux/stddef.h:11:9: error: expected identifier before ‘false’
11 | false = 0,
./include/linux/types.h:35:33: error: two or more data types in declaration specifiers
35 | typedef _Bool bool;
Set '-std=gnu11' in the x86 compressed boot Makefile to resolve the
error and consistently use the same C standard version for the entire
kernel.
Closes: https://lore.kernel.org/4OAhbllK7x4QJGpZjkYjtBYNLd_2whHx9oFiuZcGwtVR4hIzvduultkgfAIRZI3vQpZylu7Gl929HaYFRGeMEalWCpeMzCIIhLxxRhq4U-Y=@protonmail.com/
Closes: https://lore.kernel.org/Z4467umXR2PZ0M1H@tucnak/
Reported-by: Kostadin Shishmanov <kostadinshishmanov@protonmail.com>
Reported-by: Jakub Jelinek <jakub@redhat.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250121-x86-use-std-consistently-gcc-15-v1-1-8ab0acf645cb%40kernel.org
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| Makefile | ||
| acpi.c | ||
| cmdline.c | ||
| cpuflags.c | ||
| early_serial_console.c | ||
| efi.c | ||
| efi.h | ||
| efi_mixed.S | ||
| error.c | ||
| error.h | ||
| head_32.S | ||
| head_64.S | ||
| ident_map_64.c | ||
| idt_64.c | ||
| idt_handlers_64.S | ||
| kaslr.c | ||
| kernel_info.S | ||
| mem.c | ||
| mem_encrypt.S | ||
| misc.c | ||
| misc.h | ||
| mkpiggy.c | ||
| pgtable.h | ||
| pgtable_64.c | ||
| sev.c | ||
| sev.h | ||
| string.c | ||
| tdcall.S | ||
| tdx-shared.c | ||
| tdx.c | ||
| tdx.h | ||
| vmlinux.lds.S | ||