Thread overview
dmd does not show warnings by casting int to uint
Jul 21, 2009
Qian Xu
Jul 21, 2009
bearophile
Jul 22, 2009
Stewart Gordon
Jul 22, 2009
Qian Xu
July 21, 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
July 21, 2009
Qian Xu:
> I found out that dmd does not show warnings by casting int to uint.

I think D2 isn't good enough yet in such regards. If you have good ideas regarding how to improve things, then you may post them in the main D newsgroup.

Bye,
bearophile
July 22, 2009
Qian Xu wrote:
> Hi All,
> 
> I found out that dmd does not show warnings by casting int to uint.
<snip>

Known bug.

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

Stewart.
July 22, 2009
Stewart Gordon wrote:

> Qian Xu wrote:
>> Hi All,
>> 
>> I found out that dmd does not show warnings by casting int to uint.
> <snip>
> 
> Known bug.
> 
> http://d.puremagic.com/issues/show_bug.cgi?id=259
> 
> Stewart.

thanks, good to know that. i thought i have not configured dmd correctly ^^)