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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 17 04:40:42 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=259

--- Comment #60 from Dominikus Dittes Scherkl <dominikus at scherkl.de> ---
(In reply to Lionello Lunesu from comment #59)
> It's currently using the C integer promotion rules, which are consistent
> (they're rules after all) but far from simple.

Ah, ok. I see why a<b and c<d work - they are all promoted to int.
But never the less: who would be affected by changing the behaviour for int and
long? Is really anybody relying on that? And sure that was not a bug from the
beginning?
I don't think that we really should keep bugs just to be consistend with C.
--> this is a case where a compiler warning is good: "Comparing signed with
unsigned values. This works in D but may be a performance issue and behaves
different from C. Is this intended?" (of course works only after the fix :-)

--


More information about the Digitalmars-d-bugs mailing list