[Issue 259] Comparing signed to unsigned does not generate an error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 23 05:53:19 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=259





------- Comment #6 from jarrett.billingsley at gmail.com  2009-02-23 07:53 -------
(In reply to comment #5)
> > uint a = 5;
> > if (a > -2) { ... }
> > 
> 
> Why not? This is obviously a bug!

Agreed.  I can't tell you how many times I've done something stupid like:

for(uint i = something; i >= 0; i--)
{ /* yay, infinite loop! */ }

A nontrivial condition that always results in an infinite loop should never be
accepted.


-- 



More information about the Digitalmars-d-bugs mailing list