Error building gcc master: gcc/opts.cc: -Werror=format-truncation
Alejandro Colomar
alx.manpages@gmail.com
Wed Mar 15 18:15:46 GMT 2023
Hi,
I'm getting this error while building GCC from the master branch:
alx@debian:~/src/gnu/gcc/.tmp$ make 'BOOT_CFLAGS=-march=native' bootstrap
[...]
/home/alx/src/gnu/gcc/.tmp/./prev-gcc/xg++ -B/home/alx/src/gnu/gcc/.tmp/./prev-gcc/ -B/opt/gnu/gcc/alx/Wusi/1/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/home/alx/src/gnu/gcc/.tmp/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/home/alx/src/gnu/gcc/.tmp/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -I/home/alx/src/gnu/gcc/.tmp/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/home/alx/src/gnu/gcc/.tmp/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -I/home/alx/src/gnu/gcc/libstdc++-v3/libsupc++ -L/home/alx/src/gnu/gcc/.tmp/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/alx/src/gnu/gcc/.tmp/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -fno-PIE -c -march=native -fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o opts.o -MT opts.o -MMD -MP -MF ./.deps/opts.TPo ../../gcc/opts.cc
../../gcc/opts.cc: In function ‘void print_filtered_help(unsigned int, unsigned int, unsigned int, unsigned int, gcc_options*, unsigned int)’:
../../gcc/opts.cc:1685:26: error: ‘ ’ directive output may be truncated writing 2 bytes into a region of size between 1 and 256 [-Werror=format-truncation=]
1685 | "%s %s", help, _(use_diagnosed_msg));
| ^~
../../gcc/opts.cc:1684:22: note: ‘snprintf’ output 3 or more bytes (assuming 258) into a destination of size 256
1684 | snprintf (new_help, sizeof new_help,
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
1685 | "%s %s", help, _(use_diagnosed_msg));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:1152: opts.o] Error 1
My system is Debian Sid, and GCC 12.2.0:
$ gcc --version
gcc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Is it some known issue? I was trying to test a patch I'm developing,
but I can't even build from master.
Thanks,
Alex
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20230315/4609586e/attachment.sig>
More information about the Gcc-help
mailing list