Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
February 10, 2013 win64 vararg bug? | ||||
---|---|---|---|---|
| ||||
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 |
February 10, 2013 Re: win64 vararg bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | 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,"---"); } |
February 10, 2013 Re: win64 vararg bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | 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 Thaut Might be related to these: http://d.puremagic.com/issues/show_bug.cgi?id=6576 http://d.puremagic.com/issues/show_bug.cgi?id=7893 |
February 10, 2013 Re: win64 vararg bug? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Benjamin Thaut | 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 Thaut This 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... |
Copyright © 1999-2021 by the D Language Foundation