From: Erven R. <erv...@in...> - 2010-01-20 16:05:26
|
Ciao a tutti, the following piece of code does not link when -DBUG is passed (ie when the vararg method is static): "Error: Can't find method: foo" This vaguely reminds me something. Is it just me? Do you also remember a problem like this? [Note: this is cc.c-torture/execute/va-arg-11.c] Thanks, -- Erven. #include <stdarg.h> #include <stdlib.h> #ifdef BUG static #endif int foo (int a, ...) { va_list va; int i, res; va_start (va, a); for (i = 0; i < 4; ++i) (void) va_arg (va, int); res = va_arg (va, int); va_end (va); return res; } int main (void) { if (foo (5, 4, 3, 2, 1, 0)) abort (); exit (0); } |