]> git.ipfire.org Git - thirdparty/git.git/blame - config.mak.dev
pack-mtimes: support writing pack .mtimes files
[thirdparty/git.git] / config.mak.dev
CommitLineData
27e0c3c6
CMAB
1ifndef COMPILER_FEATURES
2COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
3endif
4
99f763ba 5ifeq ($(filter no-error,$(DEVOPTS)),)
6d5d4b4e 6DEVELOPER_CFLAGS += -Werror
521dc562 7SPARSE_FLAGS += -Wsparse-error
99f763ba 8endif
ebd2e4a1 9
27e0c3c6 10DEVELOPER_CFLAGS += -Wall
6a8cbc41 11ifeq ($(filter no-pedantic,$(DEVOPTS)),)
6d5d4b4e 12DEVELOPER_CFLAGS += -pedantic
ebd2e4a1 13ifneq (($or $(filter gcc5,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
6a8cbc41 14DEVELOPER_CFLAGS += -Wpedantic
ebd2e4a1
CMAB
15ifneq ($(filter gcc10,$(COMPILER_FEATURES)),)
16ifeq ($(uname_S),MINGW)
6a8cbc41 17DEVELOPER_CFLAGS += -Wno-pedantic-ms-format
27e0c3c6 18endif
6d5d4b4e 19endif
ebd2e4a1
CMAB
20endif
21endif
5f463853 22
2b95d94b 23ifneq ($(uname_S),FreeBSD)
5f463853
JK
24ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang7,$(COMPILER_FEATURES))),)
25DEVELOPER_CFLAGS += -std=gnu99
26endif
2b95d94b
JH
27else
28# FreeBSD cannot limit to C99 because its system headers unconditionally
29# rely on C11 features.
30endif
5f463853 31
6d5d4b4e
ÆAB
32DEVELOPER_CFLAGS += -Wdeclaration-after-statement
33DEVELOPER_CFLAGS += -Wformat-security
6d5d4b4e
ÆAB
34DEVELOPER_CFLAGS += -Wold-style-definition
35DEVELOPER_CFLAGS += -Woverflow
36DEVELOPER_CFLAGS += -Wpointer-arith
37DEVELOPER_CFLAGS += -Wstrict-prototypes
38DEVELOPER_CFLAGS += -Wunused
39DEVELOPER_CFLAGS += -Wvla
55391836 40DEVELOPER_CFLAGS += -fno-common
1da1580e 41
1da1580e 42ifneq ($(filter clang4,$(COMPILER_FEATURES)),)
6d5d4b4e 43DEVELOPER_CFLAGS += -Wtautological-constant-out-of-range-compare
1da1580e
NTND
44endif
45
46ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
6d5d4b4e 47DEVELOPER_CFLAGS += -Wextra
1da1580e
NTND
48# if a function is public, there should be a prototype and the right
49# header file should be included. If not, it should be static.
6d5d4b4e 50DEVELOPER_CFLAGS += -Wmissing-prototypes
26d2e4fb 51ifeq ($(filter extra-all,$(DEVOPTS)),)
1da1580e 52# These are disabled because we have these all over the place.
6d5d4b4e
ÆAB
53DEVELOPER_CFLAGS += -Wno-empty-body
54DEVELOPER_CFLAGS += -Wno-missing-field-initializers
55DEVELOPER_CFLAGS += -Wno-sign-compare
56DEVELOPER_CFLAGS += -Wno-unused-parameter
1da1580e 57endif
26d2e4fb 58endif
1da1580e
NTND
59
60# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
61# not worth fixing since newer compilers correctly stop complaining
62ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
63ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
6d5d4b4e 64DEVELOPER_CFLAGS += -Wno-uninitialized
1da1580e
NTND
65endif
66endif
5338ed2b 67
846a29af
CMAB
68# https://bugzilla.redhat.com/show_bug.cgi?id=2075786
69ifneq ($(filter gcc12,$(COMPILER_FEATURES)),)
70DEVELOPER_CFLAGS += -Wno-error=stringop-overread
9c539d10 71DEVELOPER_CFLAGS += -Wno-error=dangling-pointer
846a29af
CMAB
72endif
73
5338ed2b 74GIT_TEST_PERL_FATAL_WARNINGS = YesPlease