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 tree-optimization/84561] -Wstringop-truncation with -O2 depends on strncpy's size type


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-02-26
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  The warning suppression code sees the following statements:

  <bb 2> :
  _8 = &b_3(D)->_a;
  _9 = _8;
  ...
  _6 = &MEM[(struct String *)_1]._string;
  __builtin_strncpy (_6, "123", len_7);
  MEM[(struct String *)_1]._string[len_7] = 0;

but it doesn't have the smarts to figure out that _6 is &MEM[(struct String
*)_1]._string.

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