dmd does not show warnings by casting int to uint

Qian Xu quian.xu at stud.tu-ilmenau.de
Tue Jul 21 01:19:15 PDT 2009


Hi All,

I found out that dmd does not show warnings by casting int to uint.

demo code looks as follows:
---------------------------------------------------
module main;
void main()
{
  uint positive = 10;
  int  negative = -1;
  assert(negative < positive); // did not pass
}
---------------------------------------------------

The problem is that the integer "negative" is casted as uint (MAX_UINT)
However, I just wondered, why dmd does not show warnings?


Best regards
Qian


More information about the Digitalmars-d-learn mailing list