[PATCH 2/2] builtin/unpack-objects.c: fix compiler error on MacOS with clang 11.0.0
- From
- Jeff Hostetler via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Oct 6, 2022, 19:43 UTC
- Message-ID
- <e5009a325f234eef7e80335e458fbe11a2ccf5f4.1665085395.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1375.git.1665085395.gitgitgadget@gmail.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
Add an extra set of braces around zero initialization of the `zstream` variable to resolve compiler error/warning from clang 11.0.0 on MacOS. This is not needed on clang 14.0.
$ make builtin/unpack-objects.o
CC builtin/unpack-objects.o
builtin/unpack-objects.c:388:26: error: suggest braces around \
initialization of subobject [-Werror,-Wmissing-braces]
git_zstream zstream = { 0 };
^
{}
1 error generated.
make: *** [builtin/unpack-objects.o] Error 1Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> --- builtin/unpack-objects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c index 43789b8ef29..4b16f1592ba 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,
-- gitgitgadget