Skip to content

Commit b53a5f2

Browse files
peffgitster
authored andcommitted
config.mak.dev: squelch -Wno-missing-braces for older gcc
Versions of gcc prior to 4.9 complain about an initialization like: struct inner { int x; }; struct outer { struct inner; }; struct outer foo = { 0 }; and insist on: struct outer foo = { { 0 } }; Newer compilers handle this just fine. And ignoring the window even on older compilers is fine; the resulting code is correct, but we just get caught by -Werror. Let's relax this for older compilers to make developer lives easier (we don't care much about non-developers on old compilers; they may see a warning, but it won't stop compilation). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 00d1260 commit b53a5f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

config.mak.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ endif
5959

6060
# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
6161
# not worth fixing since newer compilers correctly stop complaining
62+
#
63+
# Likewise, gcc older than 4.9 complains about initializing a
64+
# struct-within-a-struct using just "{ 0 }"
6265
ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
6366
ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
6467
DEVELOPER_CFLAGS += -Wno-uninitialized
68+
DEVELOPER_CFLAGS += -Wno-missing-braces
6569
endif
6670
endif
6771

0 commit comments

Comments
 (0)