This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] PR5820: two CTRL-D are not enough?!?
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: pcarlini at unitus dot it
- Date: Mon, 1 Apr 2002 18:46:00 -0600 (CST)
- Subject: Re: [RFC] PR5820: two CTRL-D are not enough?!?
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
In article <3CA6FE7D.7000200@unitus.it> you write:
> this is one of weirdest PR I have seen in the last months and I have no
> idea if the current behaviour of v3 is conforming or not in this respect.
> Submitter maintains that usually two CTRL-D indicates end of output,
> whereas v3 needs /four/.
> This is the original testcase:
On i386-*-freebsd4.5 with g++ 3.1 20020329, only 1 EOF (may be CTRL-D)
is required. g++ 3.1 20020125 on sparc-sun-solaris2.7 runs the same.
; ./a.out
Enter an integer: [1 2 RET]
std::cin.eof()=0
The number was: 12
[EOF]
; ./a.out
Enter an integer: [EOF]Unexpected read problem
I am confused why more than one EOF would ever be required for this
test case, given the meaning of EOF and that this case never attempts
to explicitly reset the state of cin (i.e. yes it is possible to clear
EOF state and force more input to be read but this case doesn't do that).
Interestingly enough, both i386-*-freebsd4.5 and sparc-sun-solaris2.7
define _GLIBCPP_AVOID_FSEEK. Correlation?
Regards,
Loren
--
Loren J. Rittle
Senior Staff Software Engineer, Distributed Object Technology Lab
Networks and Infrastructure Research Lab (IL02/2240), Motorola Labs
rittle@rsch.comm.mot.com, KeyID: 2048/ADCE34A5, FDC0292446937F2A240BC07D42763672