qemu /
SLOF /
8cbddc7f5276fca93d704498a1e090dd77281bd1 Silence initializer-string warnings
Recent versions GCC (v15.2) started to complain with a lot of warnings
like these:
./dict.xt:1510:115: warning: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (9 chars into 8 available) [-Wunterminated-string-initialization]
1510 | _gpt_X2d_add_X2d_entry, { .a = xt_tpm_X2d_gpt_X2d_set_X2d_lba1 }, { .c = "\000\021tpm-gp" }, { .c = "t-add-en" }, { .c = "try" },) cod(tpm_X2d_gpt_X2d_add_X2d_entry)
| ^~~~~~~~~~
.../slof/slof/prep.h:23:62: note: in definition of macro ‘header’
23 | #define header(_xt, _header...) static cell xt_ ## _xt[] = { _header
| ^~~~~~~
./dict.xt:1512:83: warning: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (9 chars into 8 available) [-Wunterminated-string-initialization]
1512 | header(tpm_X2d_measure_X2d_gpt, { .a = xt_tpm_X2d_gpt_X2d_add_X2d_entry }, { .c = "\000\017tpm-me" }, { .c = "asure-gp" }, { .c = "t" },) cod(tpm_X2d_measure_X2d_gpt)
| ^~~~~~~~~~~~~~~~
.../slof/slof/prep.h:23:62: note: in definition of macro ‘header’
23 | #define header(_xt, _header...) static cell xt_ ## _xt[] = { _header
| ^~~~~~~
etc.
It's one of those new extra warnings that are enabled by -Wextra.
Of course we could try to go through the code bit by bit, trying
to fix those warnings, but in my experience -Wextra often causes
more hassle than being really helpful. Thus let's simply drop
it from our CFLAGS. We can then also remove the -Wno-unused-parameter
which we already had to use to tame the warnings that were enabled
by -Wextra.
Message-ID: <20251017063320.512189-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
1 file changed