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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-08-29
                 CC|                            |msebor at gcc dot gnu.org
             Blocks|                            |88443
     Ever confirmed|0                           |1
           Severity|enhancement                 |normal

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  gimple_location(stmt) returns zero for the statement but
EXPR_LOCATION(lhs) has the right location so it can be used as a fallback. 
Unfortunately, that alone isn't enough.  The %G directive in the
warning_at(loc, "%G...", stmt) call seems to insist on using the stmt location
in preference to loc even when it's invalid/unknown, and so the warning still
doesn't point in the right place.  I could hack around it at the call site but
a better fix is in the warning machinery.  (Ideally, of course, every statement
would have location and this wouldn't be a problem at all. But what fun would
that be?)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
[Bug 88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

Reply via email to