]> git.ipfire.org Git - thirdparty/git.git/blob - config.mak.dev
win32: allow building with pedantic mode enabled
[thirdparty/git.git] / config.mak.dev
1 ifndef COMPILER_FEATURES
2 COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
3 endif
4
5 ifeq ($(filter no-error,$(DEVOPTS)),)
6 DEVELOPER_CFLAGS += -Werror
7 SPARSE_FLAGS += -Wsparse-error
8 endif
9 DEVELOPER_CFLAGS += -Wall
10 ifneq ($(filter pedantic,$(DEVOPTS)),)
11 DEVELOPER_CFLAGS += -pedantic
12 ifneq ($(filter gcc5,$(COMPILER_FEATURES)),)
13 DEVELOPER_CFLAGS += -Wno-incompatible-pointer-types
14 endif
15 endif
16 DEVELOPER_CFLAGS += -Wdeclaration-after-statement
17 DEVELOPER_CFLAGS += -Wformat-security
18 DEVELOPER_CFLAGS += -Wold-style-definition
19 DEVELOPER_CFLAGS += -Woverflow
20 DEVELOPER_CFLAGS += -Wpointer-arith
21 DEVELOPER_CFLAGS += -Wstrict-prototypes
22 DEVELOPER_CFLAGS += -Wunused
23 DEVELOPER_CFLAGS += -Wvla
24 DEVELOPER_CFLAGS += -fno-common
25
26 ifneq ($(filter clang4,$(COMPILER_FEATURES)),)
27 DEVELOPER_CFLAGS += -Wtautological-constant-out-of-range-compare
28 endif
29
30 ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
31 DEVELOPER_CFLAGS += -Wextra
32 # if a function is public, there should be a prototype and the right
33 # header file should be included. If not, it should be static.
34 DEVELOPER_CFLAGS += -Wmissing-prototypes
35 ifeq ($(filter extra-all,$(DEVOPTS)),)
36 # These are disabled because we have these all over the place.
37 DEVELOPER_CFLAGS += -Wno-empty-body
38 DEVELOPER_CFLAGS += -Wno-missing-field-initializers
39 DEVELOPER_CFLAGS += -Wno-sign-compare
40 DEVELOPER_CFLAGS += -Wno-unused-parameter
41 endif
42 endif
43
44 # uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
45 # not worth fixing since newer compilers correctly stop complaining
46 ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
47 ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
48 DEVELOPER_CFLAGS += -Wno-uninitialized
49 endif
50 endif
51
52 GIT_TEST_PERL_FATAL_WARNINGS = YesPlease