diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-05-30 07:04:07 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-30 07:04:07 +0200 |
commit | 50f08db5941755b69012378bfc86f6b8ee98edf4 (patch) | |
tree | d403a1dbf522fdaab4cf6b9b508a08b3965828e2 /git-compat-util.h | |
parent | Merge branch 'rs/no-null-ptr-arith-in-fast-export' (diff) | |
parent | BUG_exit_code: fix sparse "symbol not declared" warning (diff) | |
download | git-50f08db5941755b69012378bfc86f6b8ee98edf4.tar.xz git-50f08db5941755b69012378bfc86f6b8ee98edf4.zip |
Merge branch 'js/use-bug-macro'
Developer support update, by using BUG() macro instead of die() to
mark codepaths that should not happen more clearly.
* js/use-bug-macro:
BUG_exit_code: fix sparse "symbol not declared" warning
Convert remaining die*(BUG) messages
Replace all die("BUG: ...") calls by BUG() ones
run-command: use BUG() to report bugs, not die()
test-tool: help verifying BUG() code paths
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 94a108c03e..9a64998b24 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1074,7 +1074,7 @@ int git_qsort_s(void *base, size_t nmemb, size_t size, #define QSORT_S(base, n, compar, ctx) do { \ if (qsort_s((base), (n), sizeof(*(base)), compar, ctx)) \ - die("BUG: qsort_s() failed"); \ + BUG("qsort_s() failed"); \ } while (0) #ifndef REG_STARTEND @@ -1133,6 +1133,9 @@ static inline int regexec_buf(const regex_t *preg, const char *buf, size_t size, #define HAVE_VARIADIC_MACROS 1 #endif +/* usage.c: only to be used for testing BUG() implementation (see test-tool) */ +extern int BUG_exit_code; + #ifdef HAVE_VARIADIC_MACROS __attribute__((format (printf, 3, 4))) NORETURN void BUG_fl(const char *file, int line, const char *fmt, ...); |