Linux kernel source tree
 
 
 
 
 
 
Go to file
Linus Torvalds 9d7a0577c9 gcc-15: disable '-Wunterminated-string-initialization' entirely for now
I had left the warning around but as a non-fatal error to get my gcc-15
builds going, but fixed up some of the most annoying warning cases so
that it wouldn't be *too* verbose.

Because I like the _concept_ of the warning, even if I detested the
implementation to shut it up.

It turns out the implementation to shut it up is even more broken than I
thought, and my "shut up most of the warnings" patch just caused fatal
errors on gcc-14 instead.

I had tested with clang, but when I upgrade my development environment,
I try to do it on all machines because I hate having different systems
to maintain, and hadn't realized that gcc-14 now had issues.

The ACPI case is literally why I wanted to have a *type* that doesn't
trigger the warning (see commit d5d45a7f2619: "gcc-15: make
'unterminated string initialization' just a warning"), instead of
marking individual places as "__nonstring".

But gcc-14 doesn't like that __nonstring location that shut gcc-15 up,
because it's on an array of char arrays, not on one single array:

  drivers/acpi/tables.c:399:1: error: 'nonstring' attribute ignored on objects of type 'const char[][4]' [-Werror=attributes]
    399 | static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst __nonstring = {
        | ^~~~~~

and my attempts to nest it properly with a type had failed, because of
how gcc doesn't like marking the types as having attributes, only
symbols.

There may be some trick to it, but I was already annoyed by the bad
attribute design, now I'm just entirely fed up with it.

I wish gcc had a proper way to say "this type is a *byte* array, not a
string".

The obvious thing would be to distinguish between "char []" and an
explicitly signed "unsigned char []" (as opposed to an implicitly
unsigned char, which is typically an architecture-specific default, but
for the kernel is universal thanks to '-funsigned-char').

But any "we can typedef a 8-bit type to not become a string just because
it's an array" model would be fine.

But "__attribute__((nonstring))" is sadly not that sane model.

Reported-by: Chris Clayton <chris2553@googlemail.com>
Fixes: 4b4bd8c50f ("gcc-15: acpi: sprinkle random '__nonstring' crumbles around")
Fixes: d5d45a7f26 ("gcc-15: make 'unterminated string initialization' just a warning")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-04-20 15:30:53 -07:00
Documentation 16 hotfixes. 2 are cc:stable and the remainder address post-6.14 issues 2025-04-19 21:46:58 -07:00
LICENSES LICENSES: add 0BSD license text 2024-09-01 20:43:24 -07:00
arch Miscellaneous x86 fixes: 2025-04-18 14:04:57 -07:00
block vfs-6.15-rc3.fixes.2 2025-04-19 14:31:08 -07:00
certs sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2024-09-20 19:52:48 +03:00
crypto crypto: ahash - Disable request chaining 2025-04-12 09:33:09 +08:00
drivers gcc-15: disable '-Wunterminated-string-initialization' entirely for now 2025-04-20 15:30:53 -07:00
fs gcc-15: add '__nonstring' markers to byte arrays 2025-04-20 11:57:54 -07:00
include gcc-15: acpi: sprinkle random '__nonstring' crumbles around 2025-04-20 11:57:54 -07:00
init Kconfig: switch CONFIG_SYSFS_SYCALL default to n 2025-04-15 10:28:35 +02:00
io_uring io_uring/zcrx: fix late dma unmap for a dead dev 2025-04-18 06:12:10 -06:00
ipc treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
kernel vfs-6.15-rc3.fixes.2 2025-04-19 14:31:08 -07:00
lib hardening fixes for v6.15-rc3 2025-04-18 13:20:20 -07:00
mm 16 hotfixes. 2 are cc:stable and the remainder address post-6.14 issues 2025-04-19 21:46:58 -07:00
net Including fixes from Bluetooth, CAN and Netfilter. 2025-04-17 11:45:30 -07:00
rust rust: helpers: Add dma_alloc_attrs() and dma_free_attrs() 2025-04-15 23:06:03 +02:00
samples samples/livepatch: add module descriptions 2025-04-11 17:32:38 -07:00
scripts Rust fixes for v6.15 2025-04-19 10:02:43 -07:00
security hardening: Disable GCC randstruct for COMPILE_TEST 2025-04-15 13:50:17 -07:00
sound ASoC: Fixes for v6.15 2025-04-11 15:51:19 +02:00
tools tracing fixes for v6.15 2025-04-19 11:57:36 -07:00
usr kbuild: hdrcheck: fix cross build with clang 2025-03-05 04:06:45 +09:00
virt ARM: 2025-04-08 13:47:55 -07:00
.clang-format clang-format: Update the ForEachMacros list for v6.15-rc1 2025-04-13 11:03:59 +02:00
.clippy.toml rust: give Clippy the minimum supported Rust version 2025-01-10 00:17:25 +01:00
.cocciconfig
.editorconfig .editorconfig: remove trim_trailing_whitespace option 2024-06-13 16:47:52 +02:00
.get_maintainer.ignore MAINTAINERS: Retire Ralf Baechle 2024-11-12 15:48:59 +01:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore kbuild: Create intermediate vmlinux build with relocations preserved 2025-03-17 00:29:50 +09:00
.mailmap sound fixes for 6.15-rc3 2025-04-17 10:14:51 -07:00
.rustfmt.toml
COPYING
CREDITS MAINTAINERS: update SLAB ALLOCATOR maintainers 2025-04-17 20:10:06 -07:00
Kbuild drm: ensure drm headers are self-contained and pass kernel-doc 2025-02-12 10:44:43 +02:00
Kconfig io_uring: Rename KConfig to Kconfig 2025-02-19 14:53:27 -07:00
MAINTAINERS 16 hotfixes. 2 are cc:stable and the remainder address post-6.14 issues 2025-04-19 21:46:58 -07:00
Makefile gcc-15: disable '-Wunterminated-string-initialization' entirely for now 2025-04-20 15:30:53 -07:00
README README: Fix spelling 2024-03-18 03:36:32 -06: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 reStructuredText 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.