M*Core: -Wmaybe-uninitialized

Jan-Benedict Glaw jbglaw@lug-owl.de
Fri Sep 3 22:04:13 GMT 2021


Hi!

Building current GAS (0b99a66053fa1e93a984f75a7a3d5343c74882fb) with a
current GCC leads to maybe-uninitialized warnings that seem to be
legit when building for --target=mcore-elf:

[all 2021-09-03 18:17:17] depbase=`echo config/tc-mcore.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
[all 2021-09-03 18:17:17] /usr/lib/gcc-snapshot/bin/gcc -DHAVE_CONFIG_H -I.  -I. -I. -I../bfd -I./config -I./../include -I./.. -I./../bfd -DLOCALEDIR="\"/tmp/gas-mcore-elf/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Werror -Wwrite-strings -I./../zlib -g -O2   -MT config/tc-mcore.o -MD -MP -MF $depbase.Tpo -c -o config/tc-mcore.o config/tc-mcore.c &&\
[all 2021-09-03 18:17:17] mv -f $depbase.Tpo $depbase.Po
[all 2021-09-03 18:17:19] config/tc-mcore.c: In function 'md_assemble':
[all 2021-09-03 18:17:19] config/tc-mcore.c:1599:9: error: 'output' may be used uninitialized [-Werror=maybe-uninitialized]
[all 2021-09-03 18:17:19]  1599 |   output[0] = INST_BYTE0 (inst);
[all 2021-09-03 18:17:19]       |   ~~~~~~^~~
[all 2021-09-03 18:17:19] config/tc-mcore.c:855:10: note: 'output' declared here
[all 2021-09-03 18:17:19]   855 |   char * output;
[all 2021-09-03 18:17:19]       |          ^~~~~~
[all 2021-09-03 18:17:19] config/tc-mcore.c:1599:9: error: 'output' may be used uninitialized [-Werror=maybe-uninitialized]
[all 2021-09-03 18:17:19]  1599 |   output[0] = INST_BYTE0 (inst);
[all 2021-09-03 18:17:19]       |   ~~~~~~^~~
[all 2021-09-03 18:17:19] config/tc-mcore.c:855:10: note: 'output' declared here
[all 2021-09-03 18:17:19]   855 |   char * output;
[all 2021-09-03 18:17:19]       |          ^~~~~~
[all 2021-09-03 18:17:19] config/tc-mcore.c:1599:9: error: 'output' may be used uninitialized [-Werror=maybe-uninitialized]
[all 2021-09-03 18:17:19]  1599 |   output[0] = INST_BYTE0 (inst);
[all 2021-09-03 18:17:19]       |   ~~~~~~^~~
[all 2021-09-03 18:17:19] config/tc-mcore.c:855:10: note: 'output' declared here
[all 2021-09-03 18:17:19]   855 |   char * output;
[all 2021-09-03 18:17:19]       |          ^~~~~~
[all 2021-09-03 18:17:20] cc1: all warnings being treated as errors
[all 2021-09-03 18:17:20] make[3]: *** [Makefile:1238: config/tc-mcore.o] Error 1

Maybe that's something to silence as well?

Thanks,
  Jan-Benedict
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20210904/ca0c46f0/attachment.sig>


More information about the Binutils mailing list