[Issue 2205] New: Warning on comparison between signed and unsigned
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 8 12:16:46 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2205
Summary: Warning on comparison between signed and unsigned
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P3
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: o.dathe at gmx.de
The following code does not generate a warning when compiled with -w.
int a=-1;
uint b=1;
assert (a<b);
The assertion failes since the comparison is done unsigned. I think it is a
very basic and frequent source of errors and should be taken into account if
warnings are enabled - just like in gcc -W.
--
More information about the Digitalmars-d-bugs
mailing list