From: larsxschneider@gmail.com
To: git@vger.kernel.org
Cc: peff@peff.net, Lars Schneider <larsxschneider@gmail.com>
Subject: [PATCH v1] travis-ci: override CFLAGS properly, add -Wdeclaration-after-statement
Date: Mon, 8 Feb 2016 09:59:18 +0100 [thread overview]
Message-ID: <1454921958-53129-1-git-send-email-larsxschneider@gmail.com> (raw)
From: Lars Schneider <larsxschneider@gmail.com>
The global Travis-CI environment variable CFLAGS did not override the
CFLAGS variable in the makefile. Pass CFLAGS as make variable to
override it properly.
In addition to that, add '-Wdeclaration-after-statement' to make a
Travis-CI build fail (because of '-Werror') if the code does not adhere
to the Git coding style.
Inspired-by: Jeff King <peff@peff.net>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
I made this patch because Peff pointed out to me that "git style doesn't
allow declaration-after-statement" [1]. I wonder if it would make sense
to add this check even in the makefile [2]? I am no make expert, but I
also wonder why we don't use the override directive [3] for the CFLAGS?
AFAIK this would allow a make invocation like this:
make target CFLAGS+=-Wdeclaration-after-statement
Thanks,
Lars
[1] http://www.spinics.net/lists/git/msg267273.html
[2] https://github.com/git/git/blob/ff4ea6004fb48146330d663d64a71e7774f059f9/Makefile#L377
[3] https://www.gnu.org/software/make/manual/make.html#Override-Directive
.travis.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index c3bf9c6..29abff4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,7 +20,7 @@ env:
- DEFAULT_TEST_TARGET=prove
- GIT_PROVE_OPTS="--timer --jobs 3"
- GIT_TEST_OPTS="--verbose --tee"
- - CFLAGS="-g -O2 -Wall -Werror"
+ - CFLAGS="-g -O2 -Wall -Werror -Wdeclaration-after-statement"
- 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
@@ -68,7 +68,7 @@ before_install:
echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)";
git-lfs version;
-before_script: make --jobs=2
+before_script: make CFLAGS="$CFLAGS" --jobs=2
script: make --quiet test
--
2.5.1
next reply other threads:[~2016-02-08 8:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 8:59 larsxschneider [this message]
2016-02-08 12:25 ` [PATCH v1] travis-ci: override CFLAGS properly, add -Wdeclaration-after-statement Jeff King
2016-02-09 10:06 ` Lars Schneider
2016-02-09 17:36 ` Jeff King
2016-02-09 17:47 ` Junio C Hamano
2016-02-09 20:51 ` Ramsay Jones
2016-02-09 18:42 ` Junio C Hamano
2016-02-09 18:46 ` Stefan Beller
2016-02-09 23:03 ` Roberto Tyley
2016-02-09 23:14 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1454921958-53129-1-git-send-email-larsxschneider@gmail.com \
--to=larsxschneider@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).