1 ifeq ($(filter no-error,$(DEVOPTS)),)
4 CFLAGS += -Wdeclaration-after-statement
5 CFLAGS += -Wno-format-zero-length
6 CFLAGS += -Wold-style-definition
8 CFLAGS += -Wpointer-arith
9 CFLAGS += -Wstrict-prototypes
13 ifndef COMPILER_FEATURES
14 COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
17 ifneq ($(filter clang4,$(COMPILER_FEATURES)),)
18 CFLAGS += -Wtautological-constant-out-of-range-compare
21 ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
23 # if a function is public, there should be a prototype and the right
24 # header file should be included. If not, it should be static.
25 CFLAGS += -Wmissing-prototypes
26 ifeq ($(filter extra-all,$(DEVOPTS)),)
27 # These are disabled because we have these all over the place.
28 CFLAGS += -Wno-empty-body
29 CFLAGS += -Wno-missing-field-initializers
30 CFLAGS += -Wno-sign-compare
31 CFLAGS += -Wno-unused-function
32 CFLAGS += -Wno-unused-parameter
36 # uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
37 # not worth fixing since newer compilers correctly stop complaining
38 ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
39 ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
40 CFLAGS += -Wno-uninitialized