[PATCH 11/14] cat-file.c: Initialise variable to suppress msvc warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    ...\git\builtin\cat-file.c(171) : warning C4700: uninitialized \
        local variable 'contents' used

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

Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx>
---
 builtin/cat-file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 94632db..472f3ad 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -168,7 +168,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
 	unsigned char sha1[20];
 	enum object_type type = 0;
 	unsigned long size;
-	void *contents = contents;
+	void *contents = NULL;
 
 	if (!obj_name)
 	   return 1;
-- 
1.7.3


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]