Skip to content

Commit 803a777

Browse files
Ramsay Jonesgitster
authored andcommitted
cat-file: Fix an gcc -Wuninitialized warning
After commit cbfd5e1 ("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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0a34594 commit 803a777

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/cat-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
193193
unsigned char sha1[20];
194194
enum object_type type = 0;
195195
unsigned long size;
196-
void *contents;
196+
void *contents = NULL;
197197

198198
if (!obj_name)
199199
return 1;

0 commit comments

Comments
 (0)