From: Jeff King Date: Fri, 08 Feb 2013 15:54:16 GMT Subject: Re: [PATCH] Use __VA_ARGS__ for all of error's arguments Message-ID: <20130208155416.GA20874@sigill.intra.peff.net> In-Reply-To: <1360336168-27740-1-git-send-email-kraai@ftbfs.org> On Fri, Feb 08, 2013 at 07:09:28AM -0800, Matt Kraai wrote: > From: Matt Kraai > > QNX 6.3.2 uses GCC 2.95.3 by default, and GCC 2.95.3 doesn't remove the > comma if the error macro's variable argument is left out. > > Instead of testing for a sufficiently recent version of GCC, make > __VA_ARGS__ match all of the arguments. > > [...] > > /* > * Let callers be aware of the constant return value; this can help > - * gcc with -Wuninitialized analysis. We have to restrict this trick to > - * gcc, though, because of the variadic macro and the magic ## comma pasting > - * behavior. But since we're only trying to help gcc, anyway, it's OK; other > - * compilers will fall back to using the function as usual. > + * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though, > + * because some compilers may not support variadic macros. Since we're only > + * trying to help gcc, anyway, it's OK; other compilers will fall back to > + * using the function as usual. > */ > #if defined(__GNUC__) && ! defined(__clang__) > -#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1) > +#define error(...) (error(__VA_ARGS__), -1) Acked-by: Jeff King Thanks. -Peff