From c3c3486b246fffef82b5541ca2d2850b2fcf34d5 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 2 May 2018 11:38:41 +0200 Subject: Convert remaining die*(BUG) messages These were not caught by the previous commit, as they did not match the regular expression. While at it, remove the localization from one instance: we never want BUG() messages to be translated, as they target Git developers, not the end user (hence it would be quite unhelpful to not only burden the translators, but then even end up with a bug report in a language that no core Git contributor understands). Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-compat-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-compat-util.h') diff --git a/git-compat-util.h b/git-compat-util.h index 07e383257b..3a7216f531 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1052,7 +1052,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 -- cgit 1.2.3-korg From 746ea4adc6cd88ad5f5af6beebace581fe489b2f Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Wed, 9 May 2018 18:04:06 +0100 Subject: BUG_exit_code: fix sparse "symbol not declared" warning Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- git-compat-util.h | 3 +++ t/helper/test-tool.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'git-compat-util.h') diff --git a/git-compat-util.h b/git-compat-util.h index 3a7216f531..3a051de450 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1111,6 +1111,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, ...); diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c index 5176f9f20a..805a45de9c 100644 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@ -47,7 +47,6 @@ static struct test_cmd cmds[] = { int cmd_main(int argc, const char **argv) { int i; - extern int BUG_exit_code; BUG_exit_code = 99; if (argc < 2) -- cgit 1.2.3-korg