1ifeq ($(filter no-error,$(DEVOPTS)),) 2CFLAGS += -Werror 3endif 4CFLAGS += -Wdeclaration-after-statement 5CFLAGS += -Wformat-security 6CFLAGS += -Wno-format-zero-length 7CFLAGS += -Wold-style-definition 8CFLAGS += -Woverflow 9CFLAGS += -Wpointer-arith 10CFLAGS += -Wstrict-prototypes 11CFLAGS += -Wunused 12CFLAGS += -Wvla 13 14ifndef COMPILER_FEATURES 15COMPILER_FEATURES := $(shell ./detect-compiler $(CC)) 16endif 17 18ifneq ($(filter clang4,$(COMPILER_FEATURES)),) 19CFLAGS += -Wtautological-constant-out-of-range-compare 20endif 21 22ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),) 23CFLAGS += -Wextra 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. 26CFLAGS += -Wmissing-prototypes 27ifeq ($(filter extra-all,$(DEVOPTS)),) 28# These are disabled because we have these all over the place. 29CFLAGS += -Wno-empty-body 30CFLAGS += -Wno-missing-field-initializers 31CFLAGS += -Wno-sign-compare 32CFLAGS += -Wno-unused-function 33CFLAGS += -Wno-unused-parameter 34endif 35endif 36 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 39ifneq ($(filter gcc4,$(COMPILER_FEATURES)),) 40ifeq ($(filter gcc5,$(COMPILER_FEATURES)),) 41CFLAGS += -Wno-uninitialized 42endif 43endif