[Bug middle-end/79538] missing -Wformat-overflow with %s and non-member array arguments

2017-12-14 Thread qing.zhao at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79538

Qing Zhao  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Qing Zhao  ---
this bug has been fixed in upstream. and is decided not back port to Gcc 7.
so close it as resolved

[Bug middle-end/79538] missing -Wformat-overflow with %s and non-member array arguments

2017-12-14 Thread qing.zhao at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79538

--- Comment #4 from Qing Zhao  ---
fixed in

https://gcc.gnu.org/viewcvs/gcc?view=revision=255654

[Bug middle-end/79538] missing -Wformat-overflow with %s and non-member array arguments

2017-11-20 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79538

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC|qing.zhao at oracle dot com|
   Assignee|unassigned at gcc dot gnu.org  |qing.zhao at oracle dot 
com

--- Comment #3 from Paolo Carlini  ---
Qing is on it.

[Bug middle-end/79538] missing -Wformat-overflow with %s and non-member array arguments

2017-11-20 Thread qing.zhao at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79538

Qing Zhao  changed:

   What|Removed |Added

 CC||qing.zhao at oracle dot com

--- Comment #2 from Qing Zhao  ---
this is because the routine "get_range_strlen" misses the handling of regular
arrays. adding the support should fix this issue.

[Bug middle-end/79538] missing -Wformat-overflow with %s and non-member array arguments

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

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-03-13
Summary|missing -Wformat-overflow   |missing -Wformat-overflow
   |with %s and global array|with %s and non-member
   |arguments   |array arguments
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
Confirming my own bug and adjusting the Summary to make it clear that the
problem isn't specific to global arrays and affects local arrays as well.  The
following test case shows that.

$ cat z.c && gcc -O2 -S -Wall -Wextra -Wpedantic
-fdump-tree-printf-return-value=/dev/stdout z.c
int main ()
{
  char d[3];
  char s[] = "abcd";

  __builtin_sprintf (d, "%-s", s);
  __builtin_printf ("%s\n", d);
}


;; Function main (main, funcdef_no=0, decl_uid=1794, cgraph_uid=0,
symbol_order=0) (executed once)

z.c:6: __builtin_sprintf: objsize = 3, fmtstr = "%-s"
  Directive 1 at offset 0: "%-s"
Result: 0, 0, -1, 9223372036854775807 (0, 0, -1, -1)
  Directive 2 at offset 3: "", length = 1

main ()
{
  char s[5];
  char d[3];

   [100.00%]:
  s = "abcd";
  __builtin_sprintf (, "%-s", );
  __builtin_puts ();
  d ={v} {CLOBBER};
  s ={v} {CLOBBER};
  return 0;

}