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

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -