March 17, 2005 signed / unsigned comparisons | ||||
---|---|---|---|---|
| ||||
import std.stdio; void main() { uint a = 100; int b = -1; if (a < b) writefln("a < b"); else writefln("a >= b"); } Prints "a < b". Should it really compile without any warnings / errors ? DMD.118; WinXP |
March 18, 2005 Re: signed / unsigned comparisons | ||||
---|---|---|---|---|
| ||||
Posted in reply to h3r3tic | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 h3r3tic schrieb am Thu, 17 Mar 2005 19:46:28 +0100: > import std.stdio; > > void main() > { > uint a = 100; > int b = -1; > > if (a < b) writefln("a < b"); > else writefln("a >= b"); > } > > > Prints "a < b". Should it really compile without any warnings / errors ? DMD.118; WinXP Your code is legal D. Issuing a warning would be nice. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCOmUL3w+/yD4P9tIRAraqAJsFI4NIraNG1RQWGkMZ72edUFnIHACfbXVQ OetU6JvjGOJmnsG3uP4vLXw= =vyaD -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation