[Bug middle-end/77672] wrong rich location in warning: writing a terminating nul past the end
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 22 15:01:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77672
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2016-09-22
Assignee|unassigned at gcc dot gnu.org |dmalcolm at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
To clarify: you want a substring_loc that uses the terminating nul character to
use the location of the closing quote for the caret location, like this:
v.c: In function ‘g’:
v.c:10:15: warning: writing a terminating nul past the end of the destination
[-Wformat-length=]
sprintf (d, "%-s", "abc");
^
I believe that can be done by tweaking cpp_interpret_string_1; am working on a
fix.
More information about the Gcc-bugs
mailing list