[PATCH] submodule.c: Squelch a "use before assignment" warning
From: David Aguilar <hidden>
Date: 2016-06-15 22:47:44
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: David Aguilar <hidden>
Date: 2016-06-15 22:47:44
Subsystem:
the rest · Maintainer:
Linus Torvalds
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493) compiler (and probably others) mistakenly thinks variable 'right' is used before assigned. Work it around by giving it a fake initialization. Signed-off-by: David Aguilar <redacted> --- submodule.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/submodule.c b/submodule.c
index 461faf0..0145a62 100644
--- a/submodule.c
+++ b/submodule.c@@ -38,7 +38,7 @@ void show_submodule_summary(FILE *f, const char *path, const char *del, const char *add, const char *reset) { struct rev_info rev; - struct commit *commit, *left = left, *right; + struct commit *commit, *left = left, *right = NULL; struct commit_list *merge_bases, *list; const char *message = NULL; struct strbuf sb = STRBUF_INIT;
--
1.6.5.3.171.ge36e