All of lore.kernel.org
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: "Gustavo A . R . Silva" <gustavo@embeddedor.com>,
	Joe Perches <joe@perches.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"clang-built-linux@googlegroups.com" 
	<clang-built-linux@googlegroups.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>
Subject: Re: [PATCH v2] nfs: remove incorrect fallthrough label
Date: Thu, 17 Sep 2020 06:21:13 +0000	[thread overview]
Message-ID: <5de6c6d3ced340ac80702c527bb38d12@huawei.com> (raw)

Nick Desaulniers <ndesaulniers@google.com> wrote:
> There is no case after the default from which to fallthrough to. Clang will error in this case (unhelpfully without context, see link below) and GCC will with -Wswitch-unreachable.
>
>The previous commit should have just replaced the comment with a break statement.
>
>If we consider implicit fallthrough to be a design mistake of C, then all case statements should be terminated with one of the following
>statements:
>* break
>* continue
>* return
>* __attribute__(__fallthrough__)
>* goto (plz no)
>* (call of function with __attribute__(__noreturn__))
>
>Fixes: 2a1390c95a69 ("nfs: Convert to use the preferred fallthrough macro")
>Link: https://bugs.llvm.org/show_bug.cgi?id=47539
>Suggested-by: Joe Perches <joe@perches.com>
>Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>---

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>



             reply	other threads:[~2020-09-17  6:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  6:21 linmiaohe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-09-15 23:29 [PATCH] nfs: remove incorrect fallthrough label Joe Perches
2020-09-16 20:02 ` [PATCH v2] " Nick Desaulniers
2020-09-16 20:18   ` Gustavo A. R. Silva
2020-09-16 20:19   ` Joe Perches
2020-09-17 21:41     ` Nick Desaulniers
2020-09-18  1:36       ` Joe Perches
2020-09-17  4:35   ` Nathan Chancellor

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=5de6c6d3ced340ac80702c527bb38d12@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=anna.schumaker@netapp.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=gustavo@embeddedor.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=trond.myklebust@hammerspace.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.