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

Re: [PATCH] Fixes compile warning with -Wimplicit-fallthrough CFLAGS

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jan 23, 2018, 00:54 UTC
Message-ID
<CAPig+cSuBRcM7BBw1MKOOVSZv+CVVrY-dWfSGj+31DA4QMrruA@mail.gmail.com>
In-Reply-To
<1516665078-107974-1-git-send-email-gitter.spiros@gmail.com>
On Mon, Jan 22, 2018 at 6:51 PM, Elia Pinto <gitter.spiros@gmail.com> wrote:
Show 17 quoted lines
> This patch add explicit fallthrough compiler attribute
> when needed on switch case statement eliminating
> the compile warning [-Werror=implicit-fallthrough=].
> It does this by means of a macro that takes into account
> the versions of the compilers that include that attribute.
> [...]
> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
> ---
> diff --git a/convert.c b/convert.c
> @@ -1554,7 +1554,7 @@ static int ident_filter_fn(struct stream_filter *filter,
>                 switch (ident->state) {
>                 default:
>                         strbuf_add(&ident->left, head, ident->state);
> -                       /* fallthrough */
> +                       GIT_FALLTHROUGH;
>                 case IDENT_SKIPPING:
>                         /* fallthrough */
Why doesn't this /* fallthrough */ deserve the same treatment?
>                 case IDENT_DRAINING:
Previous: Jeff KingNext: Jeff King
Message 5 of 7 in “Fixes compile warning with -Wimplicit-fallthrough CFLAGS”
  1. Fixes compile warning with -Wimplicit-fallthrough CFLAGSElia Pinto, Jan 22, 2018
  2. Jeff KingJan 23, 2018
  3. Junio C HamanoJan 23, 2018
  4. Jeff KingJan 23, 2018
  5. Eric SunshineJan 23, 2018
  6. Jeff KingJan 23, 2018
  7. Jacob KellerJan 23, 2018

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.