This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: tellg modifying the state of an input file stream
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Ivan Kolev <ikolev at abac dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sat, 20 May 2006 21:45:35 +0200
- Subject: Re: tellg modifying the state of an input file stream
- References: <1148134788.31547.ezmlm@gcc.gnu.org> <446F28AD.2030201@abac.com>
Ivan Kolev wrote:
This program prints
c = T, pos: 2
c = s, pos: 4
c =
, pos: 6
If either endl is not written to the file at line <1> or tellg() is
not called at line <2> the output is as expected, i.e.:
c = T
c = e
c = s
c = t
The correct output, which I actually get on x86-linux (and all the other
arches I have available), would be:
c = T, pos: 1
c = e, pos: 2
c = s, pos: 3
c = t, pos: 4
c =
, pos: 5
if you are really seeing something different, then it's something MinGW
specific and I would suggest reporting it to the maintainers of that
project, to begin with, because if you are *really* seeing the first
output above, then something is *badly* broken for that target and can't
be a bug in the generic code (nobody would use our library for serious
projects ;)
Thanks,
Paolo.