digitalmars.D.learn - dmd does not show warnings by casting int to uint
- Qian Xu (16/16) Jul 21 2009 Hi All,
- bearophile (4/5) Jul 21 2009 I think D2 isn't good enough yet in such regards. If you have good ideas...
-
Stewart Gordon
(5/8)
Jul 21 2009
- Qian Xu (2/13) Jul 22 2009 thanks, good to know that. i thought i have not configured dmd correctly...
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.<snip> Known bug. http://d.puremagic.com/issues/show_bug.cgi?id=259 Stewart.
Jul 21 2009
Stewart Gordon wrote:Qian Xu wrote:thanks, good to know that. i thought i have not configured dmd correctly ^^)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.
Jul 22 2009