Bug 1664 – (1.23).stringof generates bad code

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-11-13T04:13:00Z
Last change time
2014-02-24T15:32:17Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2007-11-13T04:13:26Z
Any floating point literal fails to compile inside .stringof, for example 1.23.stringof. Wrapping it in () allows it to compile, but it's buggy: pragma(msg, (25.5).stringof ~ (3.01).stringof); // prints 3.013.01 Workaround: Appending a "" makes it work correctly. This suggests a memory corruption problem. pragma(msg, (25.5).stringof ~ "" ~ (3.01).stringof);
Comment #1 by clugdbug — 2007-11-29T06:48:52Z
Fixed DMD 1.024.
Comment #2 by bugzilla — 2007-12-04T23:36:05Z
Fixed dmd 1.024 and 2.008