File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,12 +21,12 @@ addons:
2121
2222env :
2323 global :
24+ - DEVELOPER=1
2425 - P4_VERSION="15.2"
2526 - GIT_LFS_VERSION="1.1.0"
2627 - DEFAULT_TEST_TARGET=prove
2728 - GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
2829 - GIT_TEST_OPTS="--verbose --tee"
29- - CFLAGS="-g -O2 -Wall -Werror"
3030 - GIT_TEST_CLONE_2GB=YesPlease
3131 # t9810 occasionally fails on Travis CI OS X
3232 # t9816 occasionally fails with "TAP out of sequence errors" on Travis CI OS X
Original file line number Diff line number Diff line change @@ -171,6 +171,11 @@ For C programs:
171171
172172 - We try to keep to at most 80 characters per line.
173173
174+ - As a Git developer we assume you have a reasonably modern compiler
175+ and we recommend you to enable the DEVELOPER makefile knob to
176+ ensure your patch is clear of all compiler warnings we care about,
177+ by e.g. "echo DEVELOPER=1 >>config.mak".
178+
174179 - We try to support a wide range of C compilers to compile Git with,
175180 including old ones. That means that you should not use C99
176181 initializers, even if a lot of compilers grok it.
Original file line number Diff line number Diff line change @@ -380,6 +380,18 @@ ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
380380ALL_LDFLAGS = $(LDFLAGS )
381381STRIP ?= strip
382382
383+ ifdef DEVELOPER
384+ CFLAGS += -Werror \
385+ -Wdeclaration-after-statement \
386+ -Wno-format-zero-length \
387+ -Wold-style-definition \
388+ -Woverflow \
389+ -Wpointer-arith \
390+ -Wstrict-prototypes \
391+ -Wunused \
392+ -Wvla
393+ endif
394+
383395# Create as necessary, replace existing, make ranlib unneeded.
384396ARFLAGS = rcs
385397
You can’t perform that action at this time.
0 commit comments