[Bug middle-end/77799] missing -Wformat-overflow warning on a trivial sprintf overflow with no directives

2017-08-29 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77799

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||egallager at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #3 from Eric Gallager  ---
(In reply to Martin Sebor from comment #2)
> This bug was fixed along with the related pr77671 in r248035.

...so closing as FIXED then.

[Bug middle-end/77799] missing -Wformat-overflow warning on a trivial sprintf overflow with no directives

2017-08-03 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77799

--- Comment #2 from Martin Sebor  ---
This bug was fixed along with the related pr77671 in r248035.  GCC 8.0 now
prints the following:

.c: In function ‘g’:
a.c:14:15: warning: too many arguments for format [-Wformat-extra-args]
   sprintf (d, "123", 0);
   ^
a.c: In function ‘f’:
a.c:9:18: warning: ‘123’ directive writing 3 bytes into a region of size 2
[-Wformat-overflow=]
   sprintf (d, "123");
~~^
a.c:9:3: note: ‘sprintf’ output 4 bytes into a destination of size 2
   sprintf (d, "123");
   ^~

;; Function f (f, funcdef_no=0, decl_uid=1819, cgraph_uid=0, symbol_order=1)

f ()
{
   [100.00%] [count: INV]:
  sprintf (, "123"); [tail call]
  return;

}


a.c: In function ‘g’:
a.c:14:18: warning: ‘123’ directive writing 3 bytes into a region of size 2
[-Wformat-overflow=]
   sprintf (d, "123", 0);
~~^
a.c:14:3: note: ‘sprintf’ output 4 bytes into a destination of size 2
   sprintf (d, "123", 0);
   ^

;; Function g (g, funcdef_no=1, decl_uid=1822, cgraph_uid=1, symbol_order=2)

g ()
{
   [100.00%] [count: INV]:
  sprintf (, "123", 0); [tail call]
  return;

}

[Bug middle-end/77799] missing -Wformat-overflow warning on a trivial sprintf overflow with no directives

2017-04-10 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77799

Martin Sebor  changed:

   What|Removed |Added

Summary|missing -Wformat-length |missing -Wformat-overflow
   |warning on a trivial|warning on a trivial
   |sprintf overflow with no|sprintf overflow with no
   |directives  |directives

--- Comment #1 from Martin Sebor  ---
The warning has been renamed to -Wformat-overflow (and -Wformat-truncation). 
Adjusting Summary.