This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Error on va_start and non-POD type
- From: Ritchard Nash <ritchard76 at supereva dot it>
- To: gcc at gcc dot gnu dot org
- Date: 28 May 2003 00:58:24 +0200
- Subject: Error on va_start and non-POD type
- Organization:
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>