This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/77672] wrong rich location in warning: writing a terminating nul past the end
- From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 22 Sep 2016 15:01:22 +0000
- Subject: [Bug middle-end/77672] wrong rich location in warning: writing a terminating nul past the end
- Auto-submitted: auto-generated
- References: <bug-77672-4@http.gcc.gnu.org/bugzilla/>
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.