[Bug c/77690] -Wformat-length %s false positive after strlen check
nsz at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 23 15:35:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77690
nsz at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|INVALID |FIXED
--- Comment #5 from nsz at gcc dot gnu.org ---
(In reply to Martin Sebor from comment #4)
> Note that with snprintf GCC issues
>
> warning: ‘%s’ directive output may be truncated writing between 1 and 11
> bytes into a region of size 5
>
> This is also by design though I'm on the fence about warning at the same
> level or under the same option as for sprintf.
>
i opened another bug about snprintf
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77708
i think warning for snprintf is almost surely a false positive, that is hard to
suppress (and the suppression code is not idiomatic).
More information about the Gcc-bugs
mailing list