This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/4433
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: Tue, 20 Nov 2001 09:29:17 +0100
- Subject: 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