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 middle-end/77672] wrong rich location in warning: writing a terminating nul past the end


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.

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