This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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: Misreading bool from istringstream



> 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


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