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
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
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
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
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
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