diff options
author | Aditya Gupta <adityag@linux.ibm.com> | 2025-03-28 22:43:54 +0530 |
---|---|---|
committer | Reza Arbab <arbab@linux.ibm.com> | 2025-04-04 09:02:39 -0500 |
commit | 2f9c82b6c49d6fdde7495d704ad7e2ff9865033e (patch) | |
tree | caec20cad37cca548223e9af3d792185770a045c /doc/release-notes/skiboot-5.9.8.rst | |
parent | e46ba96c728478542499fd05b228987e272774f7 (diff) | |
download | skiboot-2f9c82b6c49d6fdde7495d704ad7e2ff9865033e.zip skiboot-2f9c82b6c49d6fdde7495d704ad7e2ff9865033e.tar.gz skiboot-2f9c82b6c49d6fdde7495d704ad7e2ff9865033e.tar.bz2 |
Fix -Werror=unterminated-string-initialization errors
GCC 15 has introduced errors for "unterminated-string-initialization"
Which treat any character array initialised with a string with a larger
size such that the null-character is not getting included in the
character array, GCC 15 gives a warning (and warnings are treated as
errors in skiboot compile).
This causes following errors on compiling skiboot with GCC 15:
core/init.c:79:27: error: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (9 chars into 8 available) [-Werror=unterminated-string-initialization]
79 | .eye_catcher = "OPALdbug",
| ^~~~~~~~~~
cc1: all warnings being treated as errors
...
In file included from hdata/hdata.h:8,
from hdata/spira.c:17:
hdata/spira.c:35:32: error: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (7 chars into 6 available) [-Werror=unterminated-string-initialization]
35 | .hdr = HDIF_SIMPLE_HDR("PROCIN", 1, struct proc_init_data),
| ^~~~~~~~
hdata/hdif.h:45:68: note: in definition of macro ‘HDIF_ID’
45 | #define HDIF_ID(_id) .d1f0 = CPU_TO_BE16(0xd1f0), .id = _id
| ^~~
hdata/spira.c:35:16: note: in expansion of macro ‘HDIF_SIMPLE_HDR’
35 | .hdr = HDIF_SIMPLE_HDR("PROCIN", 1, struct proc_init_data),
| ^~~~~~~~~~~~~~~
...
(similar errors few more times with hdata)
...
cc1: all warnings being treated as errors```
Fix the errors by marking character arrays which are not supposed to be
"null-terminated strings" with "nonstring" attribute, such as
eye-catchers in skiboot debug descriptor and hdif header
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Diffstat (limited to 'doc/release-notes/skiboot-5.9.8.rst')
0 files changed, 0 insertions, 0 deletions