Build failure due to format-truncation

José Rui Faustino de Sousa
Thu Jun 17 23:04:31 GMT 2021

On 17/06/21 20:51, Martin Sebor wrote:
> What stage does this happens in, and if stage 1, what is the system 
> compiler? 

I am not sure if this happens also in the earlier stages, I would have 
to do a complete rebuild and that would take some time.

I have built gcc using an altered "opts.c" so that it compiles without 
problems. After that replacing the file with the original one generates 
the error. So this is happening at the later stages of compilation.

> You need GCC 12 to reproduce it and as far as I can see
> it needs -O0 (or -Og or -Os). 

No problems with 11, 10 or 9, with the same flags.

> That seems like a unique setup.  If
> this is stage 1 it doesn't use -Werror so warnings shouldn't keep
> the build from succeeding.  If some later stage and you're using
> any unusual options (like -Og or -Os) then that would also be
> unusual.  Otherwise I'll need more info to understand what's going
> on.

This is the full command issued by make:

-B/opt/gcc/gcc-master/x86_64-pc-linux-gnu/bin/ -nostdinc++ 
  -fno-PIE -c   -O0 -g3 -ggdb3 -gdwarf-4 -fvar-tracking-assignments 
-fno-omit-frame-pointer -fstrict-overflow -fstack-check   -fchecking=1 
-DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W 
-Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag 
-Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long 
-Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common 
-DHAVE_CONFIG_H -I. -I. -I../../gcc-master/gcc -I../../gcc-master/gcc/. 
-I../../gcc-master/gcc/../libdecnumber/bid -I../libdecnumber 
-I/home/jrfsousa/Work/gcc/gcc-master/isl/include  -o opts.o -MT opts.o 
-MMD -MP -MF ./.deps/opts.TPo ../../gcc-master/gcc/opts.c

Applying the command by hand still fails, with or without the flags I 
used (-O0 -g3 -ggdb3 -gdwarf-4 -fvar-tracking-assignments 
-fno-omit-frame-pointer -fstrict-overflow -fstack-check), after removing 
"-Wall" the compilation succeeds without problems.

Thank you very much.

Best regards,
José Rui

More information about the Gcc mailing list