Merge branch 'jk/error-const-return'
* jk/error-const-return: Use __VA_ARGS__ for all of error's arguments
This commit is contained in:
commit
393b7c3cd7
@ -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
|
* Let callers be aware of the constant return value; this can help
|
||||||
* gcc with -Wuninitialized analysis. We have to restrict this trick to
|
* gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,
|
||||||
* gcc, though, because of the variadic macro and the magic ## comma pasting
|
* because some compilers may not support variadic macros. Since we're only
|
||||||
* behavior. But since we're only trying to help gcc, anyway, it's OK; other
|
* trying to help gcc, anyway, it's OK; other compilers will fall back to
|
||||||
* compilers will fall back to using the function as usual.
|
* using the function as usual.
|
||||||
*/
|
*/
|
||||||
#if defined(__GNUC__) && ! defined(__clang__)
|
#if defined(__GNUC__) && ! defined(__clang__)
|
||||||
#define error(fmt, ...) (error((fmt), ##__VA_ARGS__), -1)
|
#define error(...) (error(__VA_ARGS__), -1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
|
extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
|
||||||
|
Loading…
Reference in New Issue
Block a user