[Bug driver/126500] New: errors.cc: Add missing ATTRIBUTE_PRINTF_1 for

dragon-archer at outlook dot com via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126500

            Bug ID: 126500
           Summary: errors.cc: Add missing ATTRIBUTE_PRINTF_1 for
           Product: gcc
           Version: 16.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dragon-archer at outlook dot com
  Target Milestone: ---

gcc/errors.cc lacks ATTRIBUTE_PRINTF_1 for the definition of `warning`,
`error`, `fatal`, and `internal_error`, which generate following warnings when
compiling GCC:

../../gcc-16.1.0/gcc/errors.cc: In function 'void warning(const char*, ...)':
../../gcc-16.1.0/gcc/errors.cc:51:12: warning: function 'void warning(const
char*, ...)' might be a candidate for 'gnu_printf' format attribute
[-Wsuggest-attribute=format]
   51 |   vfprintf (stderr, format, ap);
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../gcc-16.1.0/gcc/errors.cc: In function 'void error(const char*, ...)':
../../gcc-16.1.0/gcc/errors.cc:66:12: warning: function 'void error(const
char*, ...)' might be a candidate for 'gnu_printf' format attribute
[-Wsuggest-attribute=format]
   66 |   vfprintf (stderr, format, ap);
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../gcc-16.1.0/gcc/errors.cc: In function 'void fatal(const char*, ...)':
../../gcc-16.1.0/gcc/errors.cc:83:12: warning: function 'void fatal(const
char*, ...)' might be a candidate for 'gnu_printf' format attribute
[-Wsuggest-attribute=format]
   83 |   vfprintf (stderr, format, ap);
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../gcc-16.1.0/gcc/errors.cc: In function 'void internal_error(const char*,
...)':
../../gcc-16.1.0/gcc/errors.cc:98:12: warning: function 'void
internal_error(const char*, ...)' might be a candidate for 'gnu_printf' format
attribute [-Wsuggest-attribute=format]
   98 |   vfprintf (stderr, format, ap);
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.