[PATCH] D91895: [Clang] improve -Wimplicit-fallthrough GCC compat

Nathan Chancellor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 17:07:57 PST 2020


nathanchance added a comment.

I think that not warning upon falling through to `goto` or `return` is a mistake. We have a confirmed case of a bug where `clang` would catch this bug whereas `gcc` would not: https://lore.kernel.org/lkml/20201121124019.21116-1-ogabbay@kernel.org/. I suspect that warnings from falling through to `break` and `;` make up the vast majority of the noise in the Linux kernel and I highly doubt that those are bugs. The other two generally have code flow implications that should be annotated. I will modify this patch tonight and see how many warnings we get from `goto` and `return` statements against mainline.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91895/new/

https://reviews.llvm.org/D91895



More information about the cfe-commits mailing list