Bug 8191 – cstream.printf is completely unusable on x86_64

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-06-03T05:57:00Z
Last change time
2012-07-25T08:12:25Z
Assigned to
nobody
Creator
lomereiter

Comments

Comment #0 by lomereiter — 2012-06-03T05:57:44Z
Even the simplest piece of code segfaults: import std.cstream; void main(string[] args) { auto _dout = new CFile(stdout, FileMode.Out); _dout.printf("%d", 123); } With GDC it doesn't even link. In 32-bit chroot cstream seems to work as expected.
Comment #1 by ibuclaw — 2012-07-19T04:41:28Z
This is because printf in std.stream is 32bit-centric: ---- size_t printf(const(char)[] format, ...) { va_list ap; ap = cast(va_list) &format; ap += format.sizeof; return vprintf(format, ap); } ---- on x86_64, this would pass vprintf garbage. Regards
Comment #2 by ibuclaw — 2012-07-19T04:59:22Z
Comment #3 by github-bugzilla — 2012-07-22T21:07:21Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5313288dd1015a8a117bf6fea538fa72251c6cea Merge pull request #704 from ibuclaw/issue8191 Fix cstream.printf() on x86_64.