This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Misreading bool from istringstream
- From: Phil Edwards <phil at jaj dot com>
- To: Benoît Sibaud <benoit dot sibaud at rd dot francetelecom dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Mar 2002 10:39:55 -0500
- Subject: Re: Misreading bool from istringstream
- References: <3C8E1DDB.E69488FE@rd.francetelecom.com>
> i686-pc-linux-gnu g++ 3.0.4: 1#0010
> i686-pc-linux-gnu g++ 2.95.4: 1#1000
> sparc-sun-solaris2.7 CC 5.0: 0#0110
> sparc-sun-solaris2.7 g++ 3.0.4: 1#0010
> mswin-32 VC++ 6.0: 1#0110
Huh. Looks like Sun's CC isn't handling the leading negative.
> Tested on different values with g++ 3.0.4:
> 2#0#0110
> 3#0#0110
> 11#0#0110
> 02#0#0110
> 01#1#0010
>
> Did I miss something or is it a bug?
> (i.e. currently x < 0 is true, x == 0 is false, x == 1 is true, x > 1 is
> false)
Those definitely look wrong. I understand why we're seeing eofbit (it's
the end of the string), but I wonder why we're seeing failbit as well.
I'll try and look into this.
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams