variadic functions - C++: va_list error generic thunk code fails for method -
this class:
class controlboard : public ilcd { virtual void print(const gfx_string &string, ...); // ...
this interface:
class ilcd { virtual void print(const gfx_string &string, ...) = 0; // ...
this method:
void controlboard::print(const gfx_string &string, ...) { va_list args; va_start(args, string); // ... va_end(args); }
and compilation error:
error: generic thunk code fails method 'virtual void controlboard::print(const gfx_string&, ...)' uses '...'
if method "print()" not in ilcd interface, compilation fine. need add it, don't understand why error appears ?
thank !
a simple c code va_list
int writelog ( const char *pszbuffer, ... ) { file *fp; int iret = fail; va_list valistarguments = null; fp = _tfopen( logpath, "a" ); if( null == fp ) { return fail; } if( null != pszbuffer ) { va_start( valistarguments, pszbuffer ); if( null != valistarguments ) { iret = _vftprintf(fp, pszbuffer, valistarguments); if( 0 <= iret ) { _ftprintf( fp, " \n"); fflush( fp ); iret = success; } } va_end(valistarguments); fclose( fp ); } return iret; }
Comments
Post a Comment