Important: Please read the Qt Code of Conduct -

Qt-creator and variadic functions

  • Being said that I am a complete n00b in qt development and that, of course, what I do might well be completely wrong.
    (Please do tell if it is)

    I run into a problem using qt-creator-2.5.2 / qt-4.8.4 under Linux-3.6.11 and gcc-4.6.3 as soon as I add whatever variadic function into project_main_win.cpp ( and associated header ), I mean, for example something looking like :
    @void BFT_Main_Win::I_Log(int support,int criticity,char *format,...)@

    Everything (including project_main_win.cpp) build well apart from the moc file, moc_project_main_win.cpp exhibiting a typical syntax error :
    @error: expected type-specifier before '(' token@

    As a matter of fact, the moc file get a corresponding line :
    @ case 1: _t->I_Log((reinterpret_cast< int()>(_a[1])),(reinterpret_cast< int()>(_a[2])),(reinterpret_cast< char(*)>(_a[3])),(reinterpret_cast< ()>(_a[4]))); break;@
    From which it seems to appear that the cast is not correctly specified for the fourth argument, that is to say the variable list.

    What am I doing wrong ? What did I just fail to understand ? Are there any particularity I ignore about the declaration of variadic functions ?

Log in to reply