[Issue 10644] Win64: wrong code when passing arguments through ...
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 19 00:51:08 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10644
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at digitalmars.com
--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> 2013-07-19 00:51:07 PDT ---
This shrinks down to:
---------------------
import std.c.stdio;
import std.c.stdarg;
void vpr(string format, va_list args)
{
char[128] buffer;
int count;
auto f = format.ptr;
auto p = buffer.ptr;
auto psize = buffer.length;
printf("format = %d, %s\n", cast(int)format.length, f);
count = _vsnprintf(p,psize,f,args);
printf("count = %d, p = %s\n", count, p);
}
void pr(string format, ...)
{
va_list ap;
ap = cast(va_list)&format;
ap += format.sizeof;
vpr(format, ap);
}
void main()
{
pr("%d", 42);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list