Skip to content

Commit 746ea4a

Browse files
ramsay-jonesgitster
authored andcommitted
BUG_exit_code: fix sparse "symbol not declared" warning
Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c3c3486 commit 746ea4a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

git-compat-util.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,9 @@ static inline int regexec_buf(const regex_t *preg, const char *buf, size_t size,
11111111
#define HAVE_VARIADIC_MACROS 1
11121112
#endif
11131113

1114+
/* usage.c: only to be used for testing BUG() implementation (see test-tool) */
1115+
extern int BUG_exit_code;
1116+
11141117
#ifdef HAVE_VARIADIC_MACROS
11151118
__attribute__((format (printf, 3, 4))) NORETURN
11161119
void BUG_fl(const char *file, int line, const char *fmt, ...);

t/helper/test-tool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static struct test_cmd cmds[] = {
4747
int cmd_main(int argc, const char **argv)
4848
{
4949
int i;
50-
extern int BUG_exit_code;
5150

5251
BUG_exit_code = 99;
5352
if (argc < 2)

0 commit comments

Comments
 (0)