R
Ross
Hi,
I have the following program:
#include <stdarg.h>
class A {
public:
A() { }
}
void f(A a,...) {
va_list l;
va_start(l,a);
// ...
va_end(l);
}
When I try to compile this program (using gcc), the compiler moans
about the non-POD type in the call to va_start() and threatens to abort
at runtime. Having checked the C-spec, this seems reasonable. What I'm
looking for is some kind of work-around. Is there any way I can get
this work (preferably without changing f() to take an A* argument)? Any
suggestions would be greatly appreciated (even using macroes).
Thanks in advance,
Ross
I have the following program:
#include <stdarg.h>
class A {
public:
A() { }
}
void f(A a,...) {
va_list l;
va_start(l,a);
// ...
va_end(l);
}
When I try to compile this program (using gcc), the compiler moans
about the non-POD type in the call to va_start() and threatens to abort
at runtime. Having checked the C-spec, this seems reasonable. What I'm
looking for is some kind of work-around. Is there any way I can get
this work (preferably without changing f() to take an A* argument)? Any
suggestions would be greatly appreciated (even using macroes).
Thanks in advance,
Ross