Re: [PATCH] Use __VA_ARGS__ for all of error's arguments

2013-02-08 Thread Jeff King
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_ARG

Re: [PATCH] Use __VA_ARGS__ for all of error's arguments

2013-02-07 Thread Matt Kraai
On Thu, Feb 07, 2013 at 11:24:28PM -0500, Jeff King wrote: > Should you be dropping most of the comment like this? I would expect it > to be more like: > > We have to restrict this trick to gcc, though, because we do not > assume all compilers support variadic macros. But since... I'll submit

Re: [PATCH] Use __VA_ARGS__ for all of error's arguments

2013-02-07 Thread Jeff King
On Thu, Feb 07, 2013 at 01:30:32PM -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_ARG

Re: [PATCH] Use __VA_ARGS__ for all of error's arguments

2013-02-07 Thread Matt Kraai
On Thu, Feb 07, 2013 at 01:05:19PM -0800, Junio C Hamano wrote: > Matt Kraai writes: > > > -#if defined(__GNUC__) && ! defined(__clang__) > > -#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1) > > -#endif > > +#define error(...) (error(__VA_ARGS__), -1) > > Before your change, we only de

Re: [PATCH] Use __VA_ARGS__ for all of error's arguments

2013-02-07 Thread John Keeping
On Thu, Feb 07, 2013 at 01:05:19PM -0800, Junio C Hamano wrote: > Matt Kraai writes: > > > -#if defined(__GNUC__) && ! defined(__clang__) > > -#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1) > > -#endif > > +#define error(...) (error(__VA_ARGS__), -1) > > Before your change, we only de

Re: [PATCH] Use __VA_ARGS__ for all of error's arguments

2013-02-07 Thread Junio C Hamano
Matt Kraai writes: > -#if defined(__GNUC__) && ! defined(__clang__) > -#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1) > -#endif > +#define error(...) (error(__VA_ARGS__), -1) Before your change, we only define error() macro for GCC variants, but with your patch that no longer is the c