[Issue 3468] New: dmd allows negative values to be assigned to an uint variable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Nov 2 04:16:35 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3468
Summary: dmd allows negative values to be assigned to an uint
variable
Product: D
Version: 1.050
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: qian.xu at funkwerk-itk.com
--- Comment #0 from Qian Xu <qian.xu at funkwerk-itk.com> 2009-11-02 04:16:35 PST ---
Description: "uint i = -1" is allowed by dmd 1.050.
Expectation: A warning or an error should be shown by compiling the code.
I misspelled int as uint. A boolean expression (if i < 0) always equals false.
It took me long time to debug my code. Finally I have found out, that the value
i is not -1.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list