Skip to contentSkip to conversation

fast-export.c: Initialise variable to suppress msvc warning

PATCH In review Ramsay Jones 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 10/14 fast-export.c: Initialise variable to suppress msvc warning

The msvc compiler thinks that a variable could be used while uninitialised and issues the following warning:

...\git\builtin\fast-export.c(466) : warning C4700: uninitialized \
local variable 'commit' used

In order to suppress the warning, we simply initialise the commit pointer variable to NULL.

---
 builtin/fast-export.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
builtin/fast-export.c +1 -1
index c8fd46b..38091fb 100644
@@ -463,7 +463,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
 	for (i = 0; i < pending->nr; i++) {
 		struct object_array_entry *e = pending->objects + i;
 		unsigned char sha1[20];
-		struct commit *commit = commit;
+		struct commit *commit = NULL;
 		char *full_name;
 
 		if (dwim_ref(e->name, strlen(e->name), sha1, &full_name) != 1)
Signature · 1 line
1.7.3