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