Skip to content

Commit

Permalink
Merge branch 'jk/error-const-return'
Browse files Browse the repository at this point in the history
* jk/error-const-return:
  Use __VA_ARGS__ for all of error's arguments
  • Loading branch information
Junio C Hamano committed Feb 14, 2013
2 parents 3cc3cf9 + 9798f7e commit 393b7c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,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.
*/
#if defined(__GNUC__) && ! defined(__clang__)
#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));
Expand Down

0 comments on commit 393b7c3

Please sign in to comment.