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

            Bug ID: 116218
           Summary: -Wformat-overflow in gengtype.cc
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 58816
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58816&action=edit
gengtype.ii.xz

```
$ gcc -c gengtype.ii -O3 -Werror=format-overflow
In function ‘void dump_fileloc(int, fileloc)’,
    inlined from ‘void dump_pair(int, pair_p)’ at
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/gengtype.cc:4960:16,
    inlined from ‘void dump_type_u_s(int, type_p)’ at
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/gengtype.cc:4856:17,
    inlined from ‘void dump_type(int, type_p)’ at
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/gengtype.cc:4938:21:
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/gengtype.cc:4836:11:
error: ‘%s’ directive argument is null [-Werror=format-overflow=]
 4836 |   printf ("%*cfileloc: file = %s, line = %d\n", indent, ' ',
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘void dump_fileloc(int, fileloc)’,
    inlined from ‘void dump_pair(int, pair_p)’ at
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/gengtype.cc:4960:16,
    inlined from ‘void dump_pair_list(const char*, pair_p)’ at
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/gengtype.cc:4973:15:
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/gengtype.cc:4836:11:
error: ‘%s’ directive argument is null [-Werror=format-overflow=]
 4836 |   printf ("%*cfileloc: file = %s, line = %d\n", indent, ' ',
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
```

Reply via email to