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