threads / patch / 58239

patchunpack-objects: fix build warning with gcc 4.8.5

Subject: [PATCH] unpack-objects: fix build warning with gcc 4.8.5

## tl;dr

One message between Jul 29, 2022 and Jul 29, 2022. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Đoàn Trần Công Danh· Jul 29, 2022, 09:06 UTC · lore

git_zstream's first field is a struct (z_stream), it must be initialised with {0}.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 Cc: Han Xin <hanxin.hx@alibaba-inc.com>
 Fix for hx/unpack-streaming (merged to next)
 Please feel free to squash into it.
 builtin/unpack-objects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to builtin/unpack-objects.c +1 −1
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 43789b8ef2..4b16f1592b 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -385,7 +385,7 @@ static const void *feed_input_zstream(struct input_stream *in_stream,
 
 static void stream_blob(unsigned long size, unsigned nr)
 {
-	git_zstream zstream = { 0 };
+	git_zstream zstream = { { 0 } };
 	struct input_zstream_data data = { 0 };
 	struct input_stream in_stream = {
 		.read = feed_input_zstream,
-- 
2.37.1.560.gdfb9273964

← back to recent threads