is this intended behavior?

Tom S h3r3tic at remove.mat.uni.torun.pl
Mon Apr 9 14:03:54 PDT 2007


John Demme wrote:
> unknown wrote:
> 
>> Frank Malone Wrote:
>>>         writefln(c < a ? "true" : "false"); // outputs false
>> From the documentation:
>>> It is an error to have one operand be signed and the other unsigned
>>> for a <, <=, > or >= expression. Use casts to make both operands
>>> signed or both operands unsigned.
>> Please read the documentation or post to the learn forum. thx.
>>
>> unknown []
> 
> In all fairness, DMD should catch it at compile time and throw an error.  It
> doesn't even spit out a warning.  I'd consider this a bug- the code
> shouldn't compile, or at least a warning should be issued.

Couldn't agree more. I've tripped on this exact issue a few times and 
seen numerous other people suffer from it.


--
Tomasz Stachowiak



More information about the Digitalmars-d mailing list