public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/87719] missing warning on printf %s and unterminated array
       [not found] <bug-87719-4@http.gcc.gnu.org/bugzilla/>
@ 2020-05-01 18:05 ` msebor at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: msebor at gcc dot gnu.org @ 2020-05-01 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|9.0                         |8.3.0
      Known to work|                            |10.0, 9.2.0
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
   Target Milestone|---                         |9.3
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot gnu.org

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 9 and 10 issue the expected warning, likely as a result of r264822:

pr87719.c: In function ‘f’:
pr87719.c:5:26: warning: ‘%s’ directive argument is not a nul-terminated string
[-Wformat-overflow=]
    5 |   __builtin_sprintf (d, "%s", a);   // warning, good
      |                          ^~   ~
pr87719.c:1:12: note: referenced argument declared here
    1 | const char a[] = { 'a', 'b' };
      |            ^
pr87719.c: In function ‘g’:
pr87719.c:10:22: warning: ‘%s’ directive argument is not a nul-terminated
string [-Wformat-overflow=]
   10 |   __builtin_printf ("%s", a);   // missing warning
      |                      ^~   ~
pr87719.c:1:12: note: referenced argument declared here
    1 | const char a[] = { 'a', 'b' };
      |            ^

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-01 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-87719-4@http.gcc.gnu.org/bugzilla/>
2020-05-01 18:05 ` [Bug tree-optimization/87719] missing warning on printf %s and unterminated array msebor at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).