On Jul 23, 2009, at 9:19 PM, Ted Kremenek wrote:
> This looks a little suspicious to me.  Doesn't '-1' convert to  
> 'true' when an int is casted to a bool?  This would cause 'KnowVal  
> == true' to evaluate to true even when 'KnownVal' is -1.

I think everyone else covered this already, but yes, (bool)-1 converts  
to true, but that doesn't cause 'KnowVal == true' to evaluate to true  
even when 'KnownVal' is -1 as KnownVal isn't bool.  -1 Converts to -1,  
when converted to an int, and true, when converted to an int converts  
as 1, and -1 != 1.

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to