[Bug tree-optimization/104746] [12 Regression] False positive for -Wformat-overflow=2 since r12-7033-g3c9f762ad02f398c

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 3 09:04:56 GMT 2022


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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #1)
> The warning certainly looks cryptic but seems to actually point out a real
> bug in the code: len is set to 1 less than the number of bytes the sprintf
> call writes to the buffer (the two strings plus the slash character plus the
> teminating nul byte).

Oh, I overlooked that. Thanks for the explanation, I'm going to report that to
the upstream project.


More information about the Gcc-bugs mailing list