This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/77690] -Wformat-length %s false positive after strlen check
- From: "nsz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Sep 2016 15:35:43 +0000
- Subject: [Bug c/77690] -Wformat-length %s false positive after strlen check
- Auto-submitted: auto-generated
- References: <bug-77690-4@http.gcc.gnu.org/bugzilla/>
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).