https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122700

            Bug ID: 122700
           Summary: gcc: compilation fail due to -Wformat-truncation
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Stromeko at nexgo dot de
  Target Milestone: ---

Created attachment 62818
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62818&action=edit
monkeypatch

/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/./prev-gcc/xg++
-B/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/./prev-gcc/
-B/usr/x86_64-pc-cygwin/bin/ -nostdinc++
-B/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/src/.libs
-B/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/libsupc++/.libs

-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/include/x86_64-pc-cygwin

-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/include

-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/libstdc++-v3/libsupc++
-L/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/src/.libs
-L/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build/prev-x86_64-pc-cygwin/libstdc++-v3/libsupc++/.libs
 -fno-PIE -c  
-ffile-prefix-map=/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/build=/usr/src/debug/gcc-16.0.0+20251026-0.1
-ffile-prefix-map=/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026=/usr/src/debug/gcc-16.0.0+20251026-0.1
-fno-checking -gtoggle -DIN_GCC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-error=narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Wconditionally-supported
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror  -DHAVE_CONFIG_H -fno-PIE -I. -I.
-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc
-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/.
-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/../include

-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/../libcpp/include
-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/../libcody

-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/../libdecnumber
-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/../libdecnumber/bid
-I../libdecnumber
-I/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/../libbacktrace
  -o opts.o -MT opts.o -MMD -MP -MF ./.deps/opts.TPo
/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/opts.cc
/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/opts.cc:
In function ‘void print_filtered_help(unsigned int, unsigned int, unsigned int,
unsigned int, gcc_options*, unsigned int)’:
/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/opts.cc:1759:26:
error: ‘  ’ directive output may be truncated writing 2 bytes into a region of
size between 1 and 256 [-Werror=format-truncation=]
 1759 |                       "%s  %s", help, _(use_diagnosed_msg));
      |                          ^~
/mnt/share/packages/gccmake/gcc-16/gcc/gcc.x86_64/src/gcc-16-20251026/gcc/opts.cc:1758:22:
note: ‘snprintf’ output 3 or more bytes (assuming 258) into a destination of
size 256
 1758 |             snprintf (new_help, sizeof new_help,
      |             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
 1759 |                       "%s  %s", help, _(use_diagnosed_msg));
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:1215: opts.o] Error 1

May be related to gcc#114374 as it started happening some time ago already.

Reply via email to