diff options
author | Matt Kraai <matt.kraai@amo.abbott.com> | 2013-02-08 07:09:28 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-02-08 08:22:28 -0800 |
commit | 9798f7e5f948b2586c33d850f6a00d4fc0537d75 (patch) | |
tree | 23325254b8f8ca10ed6a15337fae4a0b47008061 /git-compat-util.h | |
parent | a469a1019352b8efc4bd7003b0bd59eb60fc428c (diff) | |
download | git-9798f7e5f948b2586c33d850f6a00d4fc0537d75.tar.gz |
Use __VA_ARGS__ for all of error's arguments
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.
Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 9002bca28e..89fdf0561b 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -290,13 +290,13 @@ extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))) /* * 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. */ #ifdef __GNUC__ -#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1) +#define error(...) (error(__VA_ARGS__), -1) #endif extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params)); |