Steven Stallion wrote: > Sebastien Roy wrote: >> On Sat, 2008-08-09 at 11:17 -0500, Steven Stallion wrote: >>> Does Studio 11/uts support any macros which allow varargs to be passed >>> to a macro (__VA_ARGS__ comes to mind)? >> Yes; look for existing uses of __VA_ARGS__ in the ON source. >> -Seb > > Consider the following: > > static void ne_cmn_err(dev_info_t *, int, const char *, ...); > > #define ne_error(dip, format, ...) \ > ne_cmn_err((dip), CE_WARN, (format), __VA_ARGS__) > > If issued without varargs, the preprocessor incorrectly expands the > ne_error macro as: > > ne_cmn_err(dip, level, format, ); /* note extraneous comma */ > > Odd... I seem to recall this working just fine on studio 12 - is this a > limitation of 11 or am I missing something?
I believe the same thing exists in GCC and you need to do a D(x, args...) plus a ##args in place of __VA_ARGS__ to get rid of the comma for this case... MRJ _______________________________________________ driver-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/driver-discuss
