syphilis has asked for the wisdom of the Perl Monks concerning the following question:
which outputs (on Win32):use warnings; use Inline C => <<'EOC'; void vatest__(char* format, va_list* args) { char buf[1024]; vsprintf(buf, format, *args); errno = 0; // "Success" perror(buf); } void vatest_(char* format, va_list* args) { vatest__(format, args); } void vatest(char* format, ...) { va_list args; va_start (args, format); vatest_(format, &args); va_end (args); } SV * foo () { char* msg0 = "vatest"; char* msg1 = "foo"; char* msg2 = "bar"; double d = 12.345; unsigned long l = 1234567890; vatest("%s %s", msg0, msg1); vatest("%s %s %s %u %f", msg0, msg1, msg2, l, d); return newSViv(0); } EOC foo();
which is correct and as expected.vatest foo: No error vatest foo bar 1234567890 12.345000: No error
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XS/Inline::C and ellipsis syntax
by renodino (Curate) on Jun 28, 2008 at 14:31 UTC | |
by syphilis (Archbishop) on Jun 29, 2008 at 01:32 UTC | |
by BrowserUk (Patriarch) on Jun 29, 2008 at 02:56 UTC | |
by renodino (Curate) on Jun 29, 2008 at 04:50 UTC | |
Re: XS/Inline::C and ellipsis syntax
by salva (Canon) on Jun 29, 2008 at 16:31 UTC | |
by syphilis (Archbishop) on Jun 30, 2008 at 01:34 UTC | |
Re: XS/Inline::C and ellipsis syntax
by dzaebst (Initiate) on Jun 30, 2008 at 15:02 UTC |