diff options
| author | Kees Cook <[email protected]> | 2025-04-15 23:20:29 +0000 |
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2025-04-23 20:00:40 +0000 |
| commit | 18eb45b67544b995a8a6f48a72b816fd75776f52 (patch) | |
| tree | f8cd9d1fab5f1484d647948bb932ebb0490926bb /scripts/gcc-plugins/sancov_plugin.c | |
| parent | gcc-15: disable '-Wunterminated-string-initialization' entirely for now (diff) | |
| download | kernel-18eb45b67544b995a8a6f48a72b816fd75776f52.tar.gz kernel-18eb45b67544b995a8a6f48a72b816fd75776f52.zip | |
ACPI: tables: Add __nonstring annotations for unterminated strings
When a character array without a terminating NUL character has a static
initializer, GCC 15's -Wunterminated-string-initialization will only
warn if the array lacks the "nonstring" attribute[1]. Mark the 4-byte
ACPI identifier arrays with __nonstring (and the new __nonstring_array)
to correctly identify the char arrays as "not C strings" and thereby
eliminate the many warnings like this:
In file included from include/acpi/actbl.h:371,
from include/acpi/acpi.h:26,
from include/linux/acpi.h:26,
from drivers/acpi/tables.c:19:
include/acpi/actbl1.h:30:33: warning: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (5 chars into 4 available) [-Wunterminated-string-initialization]
30 | #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
| ^~~~~~
drivers/acpi/tables.c:400:9: note: in expansion of macro 'ACPI_SIG_BERT'
400 | ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,
| ^~~~~~~~~~~~~
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178 [1]
Signed-off-by: Kees Cook <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/sancov_plugin.c')
0 files changed, 0 insertions, 0 deletions
