[Issue 4336] New: Variadic arguments (va_arg) break with "out" parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 16 17:07:49 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4336

           Summary: Variadic arguments (va_arg) break with "out"
                    parameters
           Product: D
           Version: D1
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: sky at q1cc.net


--- Comment #0 from Markus Dangl <sky at q1cc.net> 2010-06-16 17:07:48 PDT ---
Considering the following code, both methods should print 1. I get 1245056 on
the second call. Bug was present in dmd 1.056, i upgraded to 1.062 and it
remains the same.
---

module main;

import std.stdio;
import std.stdarg;

void test_ok(int i, ...) {
    writefln(va_arg!(int)(_argptr));
}

void test_fail(out int x, ...) {
    writefln(va_arg!(int)(_argptr));
}

void main() {
    int i;
    test_ok(i, 1);
    test_fail(i, 1);
}

-- 
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