This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/77690] -Wformat-length %s false positive after strlen check


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).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]