[Bug tree-optimization/103961] [12 Regression] gcc-12 apparently miscompiles libcap's cap_to_text() function

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 11 02:12:58 GMT 2022


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #9)
> Reduced testcase:

Note this is -O1 -Wall.

This is definitely a change in objsz which is calculating the size wrong.

We get:
<source>: In function 'cap_to_text':
<source>:18:29: warning: '+' directive writing 1 byte into a region of size 0
[-Wformat-overflow=]
   18 |                 sprintf(p, "+");
      |                             ^


More information about the Gcc-bugs mailing list