Staging
v0.5.1
swh:1:snp:c5feb7ee9221a3820c8879e85e8a18470c0b3afa
Raw File
Tip revision: 041bc65923e13313ca1b77681c3b2950b5e0a163 authored by Jonathan Nieder on 19 April 2020, 23:28:57 UTC
Git 2.20.4
Tip revision: 041bc65
config.mak.dev
ifeq ($(filter no-error,$(DEVOPTS)),)
CFLAGS += -Werror
endif
ifneq ($(filter pedantic,$(DEVOPTS)),)
CFLAGS += -pedantic
# don't warn for each N_ use
CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
endif
CFLAGS += -Wdeclaration-after-statement
CFLAGS += -Wformat-security
CFLAGS += -Wno-format-zero-length
CFLAGS += -Wold-style-definition
CFLAGS += -Woverflow
CFLAGS += -Wpointer-arith
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wunused
CFLAGS += -Wvla

ifndef COMPILER_FEATURES
COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
endif

ifneq ($(filter clang4,$(COMPILER_FEATURES)),)
CFLAGS += -Wtautological-constant-out-of-range-compare
endif

ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
CFLAGS += -Wextra
# if a function is public, there should be a prototype and the right
# header file should be included. If not, it should be static.
CFLAGS += -Wmissing-prototypes
ifeq ($(filter extra-all,$(DEVOPTS)),)
# These are disabled because we have these all over the place.
CFLAGS += -Wno-empty-body
CFLAGS += -Wno-missing-field-initializers
CFLAGS += -Wno-sign-compare
CFLAGS += -Wno-unused-parameter
endif
endif

# uninitialized warnings on gcc 4.9.2 in xdiff/xdiffi.c and config.c
# not worth fixing since newer compilers correctly stop complaining
ifneq ($(filter gcc4,$(COMPILER_FEATURES)),)
ifeq ($(filter gcc5,$(COMPILER_FEATURES)),)
CFLAGS += -Wno-uninitialized
endif
endif
back to top