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