config.mak.dev 1.61 KB
Newer Older
1
ifeq ($(filter no-error,$(DEVOPTS)),)
2
DEVELOPER_CFLAGS += -Werror
3
endif
4
ifneq ($(filter pedantic,$(DEVOPTS)),)
5
DEVELOPER_CFLAGS += -pedantic
6
# don't warn for each N_ use
7 8 9 10 11 12 13 14 15 16 17 18
DEVELOPER_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
endif
DEVELOPER_CFLAGS += -Wall
DEVELOPER_CFLAGS += -Wdeclaration-after-statement
DEVELOPER_CFLAGS += -Wformat-security
DEVELOPER_CFLAGS += -Wno-format-zero-length
DEVELOPER_CFLAGS += -Wold-style-definition
DEVELOPER_CFLAGS += -Woverflow
DEVELOPER_CFLAGS += -Wpointer-arith
DEVELOPER_CFLAGS += -Wstrict-prototypes
DEVELOPER_CFLAGS += -Wunused
DEVELOPER_CFLAGS += -Wvla
19 20 21 22 23 24

ifndef COMPILER_FEATURES
COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
endif

ifneq ($(filter clang4,$(COMPILER_FEATURES)),)
25
DEVELOPER_CFLAGS += -Wtautological-constant-out-of-range-compare
26 27 28
endif

ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
29
DEVELOPER_CFLAGS += -Wextra
30 31
# if a function is public, there should be a prototype and the right
# header file should be included. If not, it should be static.
32
DEVELOPER_CFLAGS += -Wmissing-prototypes
33
ifeq ($(filter extra-all,$(DEVOPTS)),)
34
# These are disabled because we have these all over the place.
35 36 37 38
DEVELOPER_CFLAGS += -Wno-empty-body
DEVELOPER_CFLAGS += -Wno-missing-field-initializers
DEVELOPER_CFLAGS += -Wno-sign-compare
DEVELOPER_CFLAGS += -Wno-unused-parameter
39
endif
40
endif
41 42 43 44 45

# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
# not worth fixing since newer compilers correctly stop complaining
ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
46
DEVELOPER_CFLAGS += -Wno-uninitialized
47 48
endif
endif