# [PATCH 08/14] submodule.c: Initialise variables to suppress msvc warnings

1 messages from 2010-12-04 to 2010-12-04. Participants: Ramsay Jones.
Thread: https://gitlist.dev/t/25956

## Ramsay Jones, 2010-12-04 19:07

Subject: [PATCH 08/14] submodule.c: Initialise variables to suppress msvc warnings
Message-ID: <4CFA9174.6060507@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/4CFA9174.6060507%40ramsay1.demon.co.uk

```

The msvc compiler thinks that two variables could be used
while uninitialised and issues the following warnings:

    ...\git\submodule.c(147) : warning C4700: uninitialized local \
        variable 'left' used
    ...\git\submodule.c(147) : warning C4700: uninitialized local \
        variable 'right' used

In order to suppress the warnings, we simply initialise the
pointer variables to NULL.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 submodule.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/submodule.c b/submodule.c
index 91a4758..eef498a 100644
--- a/submodule.c
+++ b/submodule.c
@@ -144,7 +144,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 = right;
+	struct commit *commit, *left = NULL, *right = NULL;
 	struct commit_list *merge_bases, *list;
 	const char *message = NULL;
 	struct strbuf sb = STRBUF_INIT;
-- 
1.7.3

```
