http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47878

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-02-24 
16:20:27 UTC ---
Do you prefer the patch in #c13, or what I wrote in #c14?  I'd prefer not to
test both.
As for pointer comparisons, you can't compare the old pointer with the new one,
that triggers undefined behavior in C.  Comparing the positions is of course
possible, but then I'd say we should just go with #c13 rather than #c14.
Actually, reading the code some more, #c14 variant is quite problematic,
because
e.g. for '\n' or '\r' or ',' in some cases the last read character is not
accounted into n, thus fbuf_getptr (dtp->u.p.current_unit) - n might be one
char after what we want to return.
Sure, I can add a comment about realloc.

Reply via email to