{"thread":{"id":"48444","subject":"[PATCH] BUG_exit_code: fix sparse \"symbol not declared\" warning","startedAt":"2018-05-09T17:04:13Z","lastAt":"2018-05-09T17:04:13Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"347101","messageId":"dd1db230-9d5a-f78b-f2ec-38754135495d@ramsayjones.plus.com","threadId":"48444","inReplyTo":null,"subject":"[PATCH] BUG_exit_code: fix sparse \"symbol not declared\" warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2018-05-09T17:04:06Z","receivedAt":"2018-05-09T17:04:13Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Johannes,\n\nIf you need to re-roll your 'js/use-bug-macro' branch, could you\nplease squash this into the relevant patch (commit a86303cb5d,\n\"test-tool: help verifying BUG() code paths\", 2018-05-02).\n\nThis will, obviously, not be required if you were to implement\nJeff's suggestion (in [1]) of using an environment variable\ninstead. (which, FWIW, I prefer).\n\nThanks!\n\nATB,\nRamsay Jones\n\n[1] https://public-inbox.org/git/20180507090109.GA367@sigill.intra.peff.net/\n\n git-compat-util.h    | 3 +++\n t/helper/test-tool.c | 1 -\n 2 files changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 5a5a99af7..b7883b257 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -1116,6 +1116,9 @@ static inline int regexec_buf(const regex_t *preg, const char *buf, size_t size,\n #define HAVE_VARIADIC_MACROS 1\n #endif\n \n+/* usage.c: only to be used for testing BUG() implementation (see test-tool) */\n+extern int BUG_exit_code;\n+\n #ifdef HAVE_VARIADIC_MACROS\n __attribute__((format (printf, 3, 4))) NORETURN\n void BUG_fl(const char *file, int line, const char *fmt, ...);\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 5176f9f20..805a45de9 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -47,7 +47,6 @@ static struct test_cmd cmds[] = {\n int cmd_main(int argc, const char **argv)\n {\n \tint i;\n-\textern int BUG_exit_code;\n \n \tBUG_exit_code = 99;\n \tif (argc < 2)\n-- \n2.17.0\n"}]}