Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2013-03-26 23:20:11 +0400
committerJunio C Hamano <gitster@pobox.com>2013-03-30 10:47:00 +0400
commit803a777942b0b1c91890c2f97d4f10972cf2881e (patch)
tree209e13a413eb6a6b75c8cf60995d06983f0a23e5 /builtin/cat-file.c
parent0a34594c8340f5cf246592ec08d330901ea8951e (diff)
cat-file: Fix an gcc -Wuninitialized warning
After commit cbfd5e1c ("drop some obsolete "x = x" compiler warning hacks", 21-03-2013) removed a gcc specific hack, older versions of gcc now issue an "'contents' might be used uninitialized" warning. In order to suppress the warning, we simply initialize the variable to NULL in it's declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/cat-file.c')
-rw-r--r--builtin/cat-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index ad29000736..40f87b4649 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -193,7 +193,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;
+ void *contents = NULL;
if (!obj_name)
return 1;