I have run into a gcc 3.2.1 error with __va_copy on the PPC
architecture. I realize that va_list is defined differently on PPC;
this code used to work with gcc 2.95.3 but it doesn't anymore.
Here's my test program, valist.c:
#include <varargs.h>
class A
{
public:
A(){}
A(const A&rhs)
{
__va_copy(ap, rhs.ap);
}
private:
va_list ap;
};
int main(int argc, char *argv[])
{
return 0;
}
The error is:
valist.c: In copy constructor `A::A(const A&)':
valist.c:9: invalid conversion from `const __va_list_tag*' to
`__va_list_tag*'
Is the above usage of va_list incorrect? Does it not make sense to
apply the const qualifier to the type va_list?
An explanation is greatly appreciated.
Thanks,
Sriram