1ifeq ($(filter no-error,$(DEVOPTS)),) 2CFLAGS += -Werror 3endif 4ifneq ($(filter pedantic,$(DEVOPTS)),) 5CFLAGS += -pedantic 6# don't warn for each N_ use 7CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0 8endif 9CFLAGS += -Wdeclaration-after-statement 10CFLAGS += -Wno-format-zero-length 11CFLAGS += -Wold-style-definition 12CFLAGS += -Woverflow 13CFLAGS += -Wpointer-arith 14CFLAGS += -Wstrict-prototypes 15CFLAGS += -Wunused 16CFLAGS += -Wvla 17 18ifndef COMPILER_FEATURES 19COMPILER_FEATURES := $(shell ./detect-compiler $(CC)) 20endif 21 22ifneq ($(filter clang4,$(COMPILER_FEATURES)),) 23CFLAGS += -Wtautological-constant-out-of-range-compare 24endif 25 26ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),) 27CFLAGS += -Wextra 28# if a function is public, there should be a prototype and the right 29# header file should be included. If not, it should be static. 30CFLAGS += -Wmissing-prototypes 31ifeq ($(filter extra-all,$(DEVOPTS)),) 32# These are disabled because we have these all over the place. 33CFLAGS += -Wno-empty-body 34CFLAGS += -Wno-missing-field-initializers 35CFLAGS += -Wno-sign-compare 36CFLAGS += -Wno-unused-function 37CFLAGS += -Wno-unused-parameter 38endif 39endif 40 41# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c 42# not worth fixing since newer compilers correctly stop complaining 43ifneq ($(filter gcc4,$(COMPILER_FEATURES)),) 44ifeq ($(filter gcc5,$(COMPILER_FEATURES)),) 45CFLAGS += -Wno-uninitialized 46endif 47endif