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]

Re: libstdc++/4433

[Get raw message]
Hi,

I think that the behaviour you are reporting is not a bug.

I suggest you to confer to page 634 of Josuttis (ISBN 0-201-379-260)
where it is stated that "this value (that reported by tellp/tellg) is
*not* an integral value or simply the position of the character as an
index". So, in general, it *cannot* be directly compared with the
parameter given to a preceding seekp/seekg. In particular, the values
returned by tellp/tellg after a relative seek (which you are using) may
*differ* if you referred the seek to beg, cur, or end.

Even if some implementations happen to pass your test this does not mean
that all the implementations have to pass it to be conforming (in fact
among the 5 or 6 I have tried more than half of them do *not* pass it)

Personally, I prefer to use either only relative seeks, or absolute
seeks and tells (according to the scheme explained, f.i., in
Langer/Kreft (ISBN 0-201-18395-1)), never a mix.

Cheers,
Paolo Carlini.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4433&database=gcc




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