Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 21, 2009 dmd does not show warnings by casting int to uint | ||||
---|---|---|---|---|
| ||||
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 Re: dmd does not show warnings by casting int to uint | ||||
---|---|---|---|---|
| ||||
Posted in reply to Qian Xu | 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 Re: dmd does not show warnings by casting int to uint | ||||
---|---|---|---|---|
| ||||
Posted in reply to Qian Xu | 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 Re: dmd does not show warnings by casting int to uint | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | 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 ^^)
|
Copyright © 1999-2021 by the D Language Foundation