Hi, this probably is not the right place to ask, but anyway:
I compile wxSmith and get this warning:
\src\plugins\contrib\wxSmith\wxwidgets\wxsitem.cpp: In member function 'void wxsItem::Codef(const wxString&, ...)':
\src\plugins\contrib\wxSmith\wxwidgets\wxsitem.cpp:525:29: warning: second parameter of 'va_start' not last named argument [-Wvarargs]
for function:
void wxsItem::Codef(const wxString &Fmt,...)
{
if ( !GetCoderContext() )
{
// TODO: Debug log
return;
}
va_list ap;
va_start(ap,Fmt.c_str());
Codef(GetCoderContext(),Fmt,GetCoderContext()->m_BuildingCode,ap);
va_end(ap);
}
now i read the documentation:
void va_start (va_list ap, paramN);
paramN
Name of the last named parameter in the function definition. The arguments extracted by subsequent calls to va_arg are those after paramN.
So
va_start(ap,Fmt.c_str());
should actually be
but there is a warning in the documentation:
The parameter shall not be of a reference type, or of a type that is not compatible with the type that results when passing an argument for which there is no parameter.
or
If parm_n is declared with reference type or with a type not compatible with the type that results from default argument promotions, the behavior is undefined.
So i can not use a reference here? I have tested it and it seems to work at least with gcc5, but i do not like this "undefined"....