Commit 94f0114
committed
Suppress new gcc-15 -Wunterminated-string-initialization
GCC 15 now warns when character arrays are being initialized by strings
and terminating NUL character doesn't fit. GCC 15.1 also allows marking
such arrays with nonstring attribute to suppress the warning. W/o such
attribute, the warning becomes error due to the global -Werror. Add the
attribute accordingly.
Fixes these errors:
| ./regression_4000_data.h:7919:9: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (20 chars into 19 available) [-Werror=unterminated-string-initialization]
| 7919 | "encryption standard";
| | ^~~~~~~~~~~~~~~~~~~~~
| ./regression_4000_data.h:8387:9: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (113 chars into 112 available) [-Werror=unterminated-string-initialization]
| 8387 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomn"
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ./regression_4000.c:1295:47: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (4 chars into 3 available) [-Werror=unterminated-string-initialization]
| 1295 | static const uint8_t hash_data_sm3_a1_in[3] = "abc";
| | ^~~~~
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>1 parent d068b66 commit 94f0114
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1295 | 1298 | | |
1296 | 1299 | | |
1297 | 1300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7914 | 7914 | | |
7915 | 7915 | | |
7916 | 7916 | | |
| 7917 | + | |
| 7918 | + | |
| 7919 | + | |
7917 | 7920 | | |
7918 | 7921 | | |
7919 | 7922 | | |
| |||
8383 | 8386 | | |
8384 | 8387 | | |
8385 | 8388 | | |
| 8389 | + | |
| 8390 | + | |
| 8391 | + | |
8386 | 8392 | | |
8387 | 8393 | | |
8388 | 8394 | | |
| |||
0 commit comments