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