1664 – (1.23).stringof generates bad code

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1664 - (1.23).stringof generates bad code
Summary: (1.23).stringof generates bad code
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: wrong-code
Depends on:
Blocks:
Reported: 2007年11月13日 04:13 UTC by Don
Modified: 2014年02月24日 15:32 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2007年11月13日 04:13:26 UTC
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 Don 2007年11月29日 06:48:52 UTC
Fixed DMD 1.024.
Comment 2 Walter Bright 2007年12月04日 23:36:05 UTC
Fixed dmd 1.024 and 2.008


AltStyle によって変換されたページ (->オリジナル) /