This is the mail archive of the
mailing list for the libstdc++ project.
Re: _FORTIFY_SOURCE for std::vector
On Fri, Jun 01, 2012 at 03:52:24PM +0200, Paolo Carlini wrote:
> On 06/01/2012 03:49 PM, Jakub Jelinek wrote:
> >On Fri, Jun 01, 2012 at 03:39:12PM +0200, Paolo Carlini wrote:
> >>On 06/01/2012 03:34 PM, Jakub Jelinek wrote:
> >>>The standard -D_FORTIFY_SOURCE failure is __chk_fail (), so IMNSHO
> >>>if this is presented as _FORTIFY_SOURCE check, it should call that
> >>>and not some other function.
> >>I understand. I don't know much about -D_FORTIFY_SOURCE, honestly. I
> >>hope the diagnostics provided by __chk_fail is good enough. And
> >>well, then we really do have to explain in a comment where
> >>__chk_fail is coming from ;)
> >The default error output is like:
> I understand it's some sort of "standard" thus certainly I'm not
> going to insist, but I would like to see more clearly displayed the
> line number of the library assertion failing, see what I mean?
Well, you have the core file often (unless disabled), or could use
addr2line to decode the addresses. The point is that the fortification
checks must be very lightweight (so that people can enable them by default
for everything), and e.g. storing __LINE__ and __FILE__
everywhere where operator is used would be too expensive (grow .rodata too