From: Patrick Steinhardt Date: Fri, 01 Aug 2025 14:47:49 GMT Subject: [PATCH 3/5] reftable/stack: fix compiler warning due to missing braces Message-ID: <20250801-pks-reftable-fixes-for-libgit2-v1-3-f446e1c33cb9@pks.im> In-Reply-To: <20250801-pks-reftable-fixes-for-libgit2-v1-0-f446e1c33cb9@pks.im> While perfectly legal, older compiler toolchains complain when zero-initializing structs that contain nested structs with `{0}`: /home/libgit2/source/deps/reftable/stack.c:862:35: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] struct reftable_addition empty = REFTABLE_ADDITION_INIT; ^~~~~~~~~~~~~~~~~~~~~~ /home/libgit2/source/deps/reftable/stack.c:707:33: note: expanded from macro 'REFTABLE_ADDITION_INIT' #define REFTABLE_ADDITION_INIT {0} ^ Silence this warning by using `{{0}}` instead. Signed-off-by: Patrick Steinhardt --- reftable/stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reftable/stack.c b/reftable/stack.c index 4caf96aa1d..3480ad21c3 100644 --- a/reftable/stack.c +++ b/reftable/stack.c @@ -704,7 +704,7 @@ struct reftable_addition { uint64_t next_update_index; }; -#define REFTABLE_ADDITION_INIT {0} +#define REFTABLE_ADDITION_INIT {{0}} static int reftable_stack_init_addition(struct reftable_addition *add, struct reftable_stack *st, -- 2.50.1