git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] test-line-buffer: simplify command parsing

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2017, 03:47 UTC
Message-ID
<xmqqh8vvl7hk.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170921062242.t63u2gvpysrrmijs@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> However, each case arm of the switch falls through to the
> one below it. This is pointless (we know that a command
> starting with 'b' does not need to check any of the commands
> in the 'c' block), and it makes gcc's -Wimplicit-fallthrough
> complain.

Wow, this is an embarassment. The code tries to cleverly optimize it, and then fails miserably.

The updated one reads good.  Thanks.
Previous: Jeff KingNext: Jeff King
Message 5 of 7 in “appeasing -Wimplicit-fallthrough”
  1. 0/4 appeasing -Wimplicit-fallthroughJeff King, Sep 21, 2017
  2. 1/4 cat-file: handle NULL object_context.pathJeff King, Sep 21, 2017
  3. Jonathan NiederSep 22, 2017
  4. 2/4 test-line-buffer: simplify command parsingJeff King, Sep 21, 2017
  5. Junio C HamanoSep 22, 2017
  6. 3/4 curl_trace(): eliminate switch fallthroughJeff King, Sep 21, 2017
  7. 4/4 consistently use "fallthrough" comments in switchesJeff King, Sep 21, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.