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