Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gcc 3.2.1 error when invoking __va_copy with const argument

1 view
Skip to first unread message

Sriram

unread,
Aug 26, 2003, 3:35:16 AM8/26/03
to
Hello folks,

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

0 new messages