summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-03-29 17:03:22 +0200
committerJunio C Hamano <gitster@pobox.com>2018-03-29 09:24:15 -0700
commit86fc3ff3bd4c7f66f23ee3328e964470d0a8dbb7 (patch)
treea9ee2443242cea58d54c7595f649fbe4eae92766
parente0a9fff10ba202580497163e22fc5da0382c201d (diff)
downloadgit-nd/warn-more-for-devs.tar.gz
Makefile: add EAGER_DEVELOPER modend/warn-more-for-devs
This mode is for developers who want to keep the code base clean. There are warning classes that are currently suppressed because we have too many of them in the code base. This mode will stop the suppression, let the developer see and decide how to fix them. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Makefile7
-rw-r--r--config.mak.dev4
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e6680a8977..e4f04ce1cb 100644
--- a/Makefile
+++ b/Makefile
@@ -434,7 +434,9 @@ all::
#
# Define DEVELOPER to enable more compiler warnings. Compiler version
# and faimily are auto detected, but could be overridden by defining
-# COMPILER_FEATURES (see config.mak.dev)
+# COMPILER_FEATURES (see config.mak.dev).
+# Define EAGER_DEVELOPER keeps compiler warnings non-fatal, but no warning
+# class is suppressed anymore.
GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -1041,6 +1043,9 @@ include config.mak.uname
-include config.mak.autogen
-include config.mak
+ifdef EAGER_DEVELOPER
+DEVELOPER = Yes
+endif
ifdef DEVELOPER
include config.mak.dev
endif
diff --git a/config.mak.dev b/config.mak.dev
index 716a14ecc7..13883410b3 100644
--- a/config.mak.dev
+++ b/config.mak.dev
@@ -1,4 +1,6 @@
+ifndef EAGER_DEVELOPER
CFLAGS += -Werror
+endif
CFLAGS += -Wdeclaration-after-statement
CFLAGS += -Wno-format-zero-length
CFLAGS += -Wold-style-definition
@@ -21,6 +23,7 @@ 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
+ifndef EAGER_DEVELOPER
# These are disabled because we have these all over the place.
CFLAGS += -Wno-empty-body
CFLAGS += -Wno-missing-field-initializers
@@ -28,6 +31,7 @@ CFLAGS += -Wno-sign-compare
CFLAGS += -Wno-unused-function
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