summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:27 (GMT)
commit0f0dd370c84b4068bd80cbab30cb2ea67abedbe0 (patch)
tree9200b08684af983b6bb34017e1d26471b31b3178
parent69616f7436ed52476180f602727b387408266873 (diff)
parent658df95a4adb825f0c8a5faea7b545da6d1d5003 (diff)
downloadgit-0f0dd370c84b4068bd80cbab30cb2ea67abedbe0.zip
git-0f0dd370c84b4068bd80cbab30cb2ea67abedbe0.tar.gz
git-0f0dd370c84b4068bd80cbab30cb2ea67abedbe0.tar.bz2
Merge branch 'ls/makefile-cflags-developer-tweak'
There is a new DEVELOPER knob that enables many compiler warning options in the Makefile. * ls/makefile-cflags-developer-tweak: add DEVELOPER makefile knob to check for acknowledged warnings
-rw-r--r--.travis.yml2
-rw-r--r--Documentation/CodingGuidelines5
-rw-r--r--Makefile12
3 files changed, 18 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index f8b73ec..78e433b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,12 +21,12 @@ addons:
env:
global:
+ - DEVELOPER=1
- P4_VERSION="15.2"
- GIT_LFS_VERSION="1.1.0"
- DEFAULT_TEST_TARGET=prove
- GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
- GIT_TEST_OPTS="--verbose --tee"
- - CFLAGS="-g -O2 -Wall -Werror"
- GIT_TEST_CLONE_2GB=YesPlease
# t9810 occasionally fails on Travis CI OS X
# t9816 occasionally fails with "TAP out of sequence errors" on Travis CI OS X
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index c6e536f..0ddd368 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -171,6 +171,11 @@ For C programs:
- We try to keep to at most 80 characters per line.
+ - As a Git developer we assume you have a reasonably modern compiler
+ and we recommend you to enable the DEVELOPER makefile knob to
+ ensure your patch is clear of all compiler warnings we care about,
+ by e.g. "echo DEVELOPER=1 >>config.mak".
+
- We try to support a wide range of C compilers to compile Git with,
including old ones. That means that you should not use C99
initializers, even if a lot of compilers grok it.
diff --git a/Makefile b/Makefile
index 10566d6..24bef8d 100644
--- a/Makefile
+++ b/Makefile
@@ -380,6 +380,18 @@ ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
STRIP ?= strip
+ifdef DEVELOPER
+CFLAGS += -Werror \
+ -Wdeclaration-after-statement \
+ -Wno-format-zero-length \
+ -Wold-style-definition \
+ -Woverflow \
+ -Wpointer-arith \
+ -Wstrict-prototypes \
+ -Wunused \
+ -Wvla
+endif
+
# Create as necessary, replace existing, make ranlib unneeded.
ARFLAGS = rcs