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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
00d12607a2
commit
b53a5f2416
@ -59,9 +59,13 @@ endif
|
|||||||
|
|
||||||
# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
|
# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
|
||||||
# not worth fixing since newer compilers correctly stop complaining
|
# not worth fixing since newer compilers correctly stop complaining
|
||||||
|
#
|
||||||
|
# Likewise, gcc older than 4.9 complains about initializing a
|
||||||
|
# struct-within-a-struct using just "{ 0 }"
|
||||||
ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
|
ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
|
||||||
ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
|
ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
|
||||||
DEVELOPER_CFLAGS += -Wno-uninitialized
|
DEVELOPER_CFLAGS += -Wno-uninitialized
|
||||||
|
DEVELOPER_CFLAGS += -Wno-missing-braces
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user