Re: [PATCH 2/5] [v2] acpi: disable -Wstringop-truncation

2024-04-09 Thread Rafael J. Wysocki
On Tue, Apr 9, 2024 at 4:01 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > gcc -Wstringop-truncation warns about copying a string that results in a > missing nul termination: > > drivers/acpi/acpica/tbfind.c: In function 'acpi_tb_find_table': > drivers/acpi/acpica/tbfind.c:60:9: error: 'strn

[PATCH 5/5] [v2] kbuild: enable -Wstringop-truncation globally

2024-04-09 Thread Arnd Bergmann
From: Arnd Bergmann The remaining warnings of this type have been addressed, so it can now be enabled by default, rather than only for W=1. Signed-off-by: Arnd Bergmann --- v2: no changes --- scripts/Makefile.extrawarn | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/Makefile.extrawa

[PATCH 4/5] [v2] blktrace: convert strncpy() to strscpy_pad()

2024-04-09 Thread Arnd Bergmann
From: Arnd Bergmann gcc-9 warns about a possibly non-terminated string copy: kernel/trace/blktrace.c: In function 'do_blk_trace_setup': kernel/trace/blktrace.c:527:2: error: 'strncpy' specified bound 32 equals destination size [-Werror=stringop-truncation] Newer versions are fine here because

[PATCH 3/5] [v2] block/partitions/ldm: convert strncpy() to strscpy()

2024-04-09 Thread Arnd Bergmann
From: Arnd Bergmann The strncpy() here can cause a non-terminated string, which older gcc versions such as gcc-9 warn about: In function 'ldm_parse_tocblock', inlined from 'ldm_validate_tocblocks' at block/partitions/ldm.c:386:7, inlined from 'ldm_partition' at block/partitions/ldm.c:145

[PATCH 2/5] [v2] acpi: disable -Wstringop-truncation

2024-04-09 Thread Arnd Bergmann
From: Arnd Bergmann gcc -Wstringop-truncation warns about copying a string that results in a missing nul termination: drivers/acpi/acpica/tbfind.c: In function 'acpi_tb_find_table': drivers/acpi/acpica/tbfind.c:60:9: error: 'strncpy' specified bound 6 equals destination size [-Werror=stringop-t

[PATCH 1/5] [v2] test_hexdump: avoid string truncation warning

2024-04-09 Thread Arnd Bergmann
From: Arnd Bergmann gcc can warn when a string is too long to fit into the strncpy() destination buffer, as it is here depending on the function arguments: inlined from 'test_hexdump_prepare_test.constprop' at /home/arnd/arm-soc/lib/test_hexdump.c:116:3: include/linux/fortify-string.h:108:3