On 20.06.2011, at 16:43, Michael Sweet wrote: > On Jun 20, 2011, at 5:24 AM, MacArthur, Ian (SELEX GALILEO, UK) wrote: >> I just noticed I mis-spelled the lib name in the title; fltk or flth >> anyone? >> >> >>>> The "first" option that the compiler offers is the one expanding >>>> "alert(va_list, const char *);" where the va_list is >>> expanded here as a >>>> "char*", so it's (possibly) not really in our remit to be >>> able to set >>>> how the va_list is interpreted? >>> >>> Oh, I was under the impression there explicitly exist 2 alert() >>> functions - this is what I get for not reading the source! >> >> There are two, being: >> >> A) FLTK3_EXPORT void alert(const char *,...) __fl_attr((__format__ >> (__printf__, 1, 2))); >> B) FLTK3_EXPORT void alert(va_list, const char *); > > FWIW, the normal convention for these sorts of things is to put the va_list > argument last to be consistent with the variable argument version (e.g. > snprintf vs. vsnprintf), however in this case it looks like MingW is not > providing a true type for va_list but it simply mapping it to char * (!?!) > which is causing problems here and likely elsewhere for other C++ code. > > Since we've had issues with this in the past (look at the mess we have to > Fl_Pixmap constructors) I would recommend renaming to avoid ambiguity, e.g.: > > FLTK3_EXPORT void alert(const char *, ...) __fl_attr((__format__(__printf__, > 1, 2))); > FLTK3_EXPORT void valert(const char *, va_list);
At first, I had va_list as the last argument, but then I received a similar warning, which is why I moved it to the front. I now added va_ as a prefix and everything is fine. Should I also move va_list to the end of the argument list again? _______________________________________________ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev