digitalmars.D - win64 vararg bug?
- Benjamin Thaut (18/18) Feb 10 2013 I have this small test program, it will crash when compiled on x64
- Benjamin Thaut (12/23) Feb 10 2013 This only seems to happen when the argument before the variadic argument...
- Nick Sabalausky (5/24) Feb 10 2013 Might be related to these:
- kinke (4/20) Feb 10 2013 This works for me when using
- kinke (1/1) Feb 10 2013 Sorry about that, I thought I was browsing the LDC newsgroup. ;)
I have this small test program, it will crash when compiled on x64 windows, but it works fine on 32bit windows. What am I doing wrong? import core.vararg; import std.stdio; void print(string fmt, ...) { auto arg = va_arg!(const(char)[])(_argptr); writefln(fmt ~ arg); } void main(string[] args) { print("+++","---"); } Kind Regards Benjamin Thaut -- Kind Regards Benjamin Thaut
Feb 10 2013
Am 10.02.2013 09:18, schrieb Benjamin Thaut:import core.vararg; import std.stdio; void print(string fmt, ...) { auto arg = va_arg!(const(char)[])(_argptr); writefln(fmt ~ arg); } void main(string[] args) { print("+++","---"); }This only seems to happen when the argument before the variadic argument list is bigger then 8 byte. This works: void print(int fmt, ...) { auto arg = va_arg!(const(char)[])(_argptr); writefln("%s %s",fmt,arg); } void main(string[] args) { print(1,"---"); }
Feb 10 2013
On Sun, 10 Feb 2013 09:18:58 +0100 Benjamin Thaut <code benjamin-thaut.de> wrote:I have this small test program, it will crash when compiled on x64 windows, but it works fine on 32bit windows. What am I doing wrong? import core.vararg; import std.stdio; void print(string fmt, ...) { auto arg = va_arg!(const(char)[])(_argptr); writefln(fmt ~ arg); } void main(string[] args) { print("+++","---"); } Kind Regards Benjamin ThautMight be related to these: http://d.puremagic.com/issues/show_bug.cgi?id=6576 http://d.puremagic.com/issues/show_bug.cgi?id=7893
Feb 10 2013
On Sunday, 10 February 2013 at 08:18:50 UTC, Benjamin Thaut wrote:I have this small test program, it will crash when compiled on x64 windows, but it works fine on 32bit windows. What am I doing wrong? import core.vararg; import std.stdio; void print(string fmt, ...) { auto arg = va_arg!(const(char)[])(_argptr); writefln(fmt ~ arg); } void main(string[] args) { print("+++","---"); } Kind Regards Benjamin ThautThis works for me when using https://github.com/ldc-developers/ldc/pull/287 and LLVM 3.2. LDC currently uses the incompatible System V ABI for Win64...
Feb 10 2013
Sorry about that, I thought I was browsing the LDC newsgroup. ;)
Feb 10 2013