Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ACPICA: Introduce ACPI_NONSTRING

ACPICA commit 878823ca20f1987cba0c9d4c1056be0d117ea4fe

In order to distinguish character arrays from C Strings (i.e. strings with
a terminating NUL character), add support for the "nonstring" attribute
provided by GCC. (A better name might be "ACPI_NONCSTRING", but that's
the attribute name, so stick to the existing naming convention.)

GCC 15's -Wunterminated-string-initialization will warn about truncation
of the NUL byte for string initializers unless the destination is marked
with "nonstring". Prepare for applying this attribute to the project.

Link: https://github.com/acpica/acpica/commit/878823ca
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/1841930.VLH7GnMWUR@rjwysocki.net
Signed-off-by: Kees Cook <kees@kernel.org>
[ rjw: Pick up the tag from Kees ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Kees Cook and committed by
Rafael J. Wysocki
6da5e6f3 e91e5964

+12
+4
include/acpi/actypes.h
··· 1327 1327 #define ACPI_FLEX_ARRAY(TYPE, NAME) TYPE NAME[0] 1328 1328 #endif 1329 1329 1330 + #ifndef ACPI_NONSTRING 1331 + #define ACPI_NONSTRING /* No terminating NUL character */ 1332 + #endif 1333 + 1330 1334 #endif /* __ACTYPES_H__ */
+8
include/acpi/platform/acgcc.h
··· 72 72 TYPE NAME[]; \ 73 73 } 74 74 75 + /* 76 + * Explicitly mark strings that lack a terminating NUL character so 77 + * that ACPICA can be built with -Wunterminated-string-initialization. 78 + */ 79 + #if __has_attribute(__nonstring__) 80 + #define ACPI_NONSTRING __attribute__((__nonstring__)) 81 + #endif 82 + 75 83 #endif /* __ACGCC_H__ */