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. Note that we had the discussion around whether or not we want to handle such errors in the past already [1], where we basically decided that we do not care about such old-and-buggy compilers. But the reftable library is a special case because it is used by projects other than Git, and libgit2 for example hits the above issue in its pipeline. As there is only a single problematic instance of this issue we do the pragmatic thing and simply make the compiler happy. [1]: https://lore.kernel.org/git/20220710081135.74964-1-sunshine@xxxxxxxxxxxxxx/T/ Signed-off-by: Patrick Steinhardt <ps@xxxxxx> --- 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.723.g3e08bea96f.dirty