Error on va_start and non-POD type
Ritchard Nash
ritchard76@supereva.it
Tue May 27 23:00:00 GMT 2003
Hi,
during a compilation the gcc 3.2.2 gave me this error:
---------------------------------------------------------
pdb.cc: In function `int pdbIsAvailable(TclInterp_cl&, ...)':
pdb.cc:233: cannot pass objects of non-POD type `class TclInterp_cl'
through
`...'
pdb.cc:233: warning: second parameter of `va_start' not last named
argument
---------------------------------------------------------
The snippet of code that cause the error is :
----------------------------------------------------------
int pdbIsAvailable( TclInterp_cl& tcl, ... )
{
va_list ap;
char *foo;
TclInterp_cl &interp = (va_start(ap,tcl),tcl); // line 233
int t;
strcpy(pdbBuf, "[pdbIsAvailable ");
while( (foo = va_arg(ap, char *)) != NULL ) {
strcat(pdbBuf, foo);
strcat(pdbBuf, " "); } va_end(ap);
strcat(pdbBuf, "]");
Tcl_ExprBoolean( interp.GetInterp(), pdbBuf, &t );
return t;
}
---------------------------------------------------------
Where TclInterp_cl is a C++ wrapper of TclInterp from the Tcl source
code. TclInterp_cl is defined as non-POD type(because of a user-defined
destructor) but since it isn't actually passed trough "..." why the
complier complain that way ?
There are known bug about va_start ?
Someone has ideas ?
--
Best Regards,
Ritchard Nash <ritchard76@supereva.it>
More information about the Gcc
mailing list