Bug 7367 – wrong char comparison result

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-24T20:07:00Z
Last change time
2012-01-25T17:09:27Z
Keywords
wrong-code
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2012-01-24T20:07:07Z
With DMD 2.058head the following code asserts during runtime: void main(){ char a = '\x00'; char b = '\xFF'; int c = b; assert(a < c); // ok assert(a < b); // fail assert(a < cast(int)b); // fail }
Comment #1 by github-bugzilla — 2012-01-25T17:08:11Z
Comment #2 by github-bugzilla — 2012-01-25T17:08:28Z