This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: tellg modifying the state of an input file stream


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.


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