digitalmars.D.learn - dmd does not show warnings by casting int to uint
- Qian Xu <quian.xu stud.tu-ilmenau.de> Jul 21 2009
- bearophile <bearophileHUGS lycos.com> Jul 21 2009
- Stewart Gordon <smjg_1998 yahoo.com> Jul 21 2009
- Qian Xu <quian.xu stud.tu-ilmenau.de> Jul 22 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
Jul 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
Jul 21 2009
Qian Xu wrote:Hi All, I found out that dmd does not show warnings by casting int to uint.
Known bug. http://d.puremagic.com/issues/show_bug.cgi?id=259 Stewart.
Jul 21 2009
Stewart Gordon wrote:Qian Xu wrote:Hi All, I found out that dmd does not show warnings by casting int to uint.
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 ^^)
Jul 22 2009









bearophile <bearophileHUGS lycos.com> 