From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 0/4] appeasing -Wimplicit-fallthrough
Date: Thu, 21 Sep 2017 02:20:43 -0400 [thread overview]
Message-ID: <20170921062043.la2f3pjsnojirzyw@sigill.intra.peff.net> (raw)
I noticed that gcc 7 ships with a new implicit-fallthrough warning that
tries to find accidental switch-case fallthroughs. It's enabled with
-Wextra, or you can turn it on separately. I don't think it finds any
real bugs in the current code, but it does seem like something that's
potentially worth paying attention to.
So here's a series that squelches the false positives. The first patch
is a real bug-fix that I found while poking around, and can be taken
separately. The middle ones improve code readability, IMHO. And the
final one just annotates the code to shut up the compiler warning.
[1/4]: cat-file: handle NULL object_context.path
[2/4]: test-line-buffer: simplify command parsing
[3/4]: curl_trace(): eliminate switch fallthrough
[4/4]: consistently use "fallthrough" comments in switches
apply.c | 3 ++-
builtin/cat-file.c | 5 +++--
builtin/checkout.c | 1 +
builtin/remote-ext.c | 2 +-
builtin/submodule--helper.c | 1 +
config.c | 1 +
convert.c | 3 ++-
fsck.c | 1 +
http-push.c | 1 +
http.c | 7 ++++---
mailinfo.c | 1 +
quote.c | 1 +
read-cache.c | 1 +
send-pack.c | 2 +-
t/helper/test-line-buffer.c | 32 +++++++++++---------------------
t/t8010-cat-file-filters.sh | 5 +++++
16 files changed, 37 insertions(+), 30 deletions(-)
next reply other threads:[~2017-09-21 6:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 6:20 Jeff King [this message]
2017-09-21 6:21 ` [PATCH 1/4] cat-file: handle NULL object_context.path Jeff King
2017-09-22 0:58 ` Jonathan Nieder
2017-09-21 6:22 ` [PATCH 2/4] test-line-buffer: simplify command parsing Jeff King
2017-09-22 3:47 ` Junio C Hamano
2017-09-21 6:23 ` [PATCH 3/4] curl_trace(): eliminate switch fallthrough Jeff King
2017-09-21 6:25 ` [PATCH 4/4] consistently use "fallthrough" comments in switches Jeff King
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170921062043.la2f3pjsnojirzyw@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).