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