BUG_exit_code: fix sparse "symbol not declared" warning
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
May 9, 2018 at 18:04 UTC
746ea4adc6cd88ad5f5af6beebace581fe489b2f
2 files changed
+3
-1
git-compat-util.h
+3
@@ -1111,6 +1111,9 @@ static inline int regexec_buf(const regex_t *preg, const char *buf, size_t size,
1111
#define HAVE_VARIADIC_MACROS 1
1112
#endif
1113
1114
+/* usage.c: only to be used for testing BUG() implementation (see test-tool) */
1115
+extern int BUG_exit_code;
1116
+
1117
#ifdef HAVE_VARIADIC_MACROS
1118
__attribute__((format (printf, 3, 4))) NORETURN
1119
void BUG_fl(const char *file, int line, const char *fmt, ...);
t/helper/test-tool.c
-1
@@ -47,7 +47,6 @@ static struct test_cmd cmds[] = {
47
int cmd_main(int argc, const char **argv)
48
{
49
int i;
50
- extern int BUG_exit_code;
50
51
BUG_exit_code = 99;
52
if (argc < 2)