[PATCH] Allow client use of -Wimplicit-fallthrough and fix a potential fallthrough bug

Richard Smith richard at metafoo.co.uk
Thu Jun 13 15:09:03 PDT 2013

On Thu, Jun 13, 2013 at 2:37 PM, Luke Zarko <zarko at google.com> wrote:
> I'm building a Clang tool and would like to compile it with
> -Wimplicit-fallthrough turned on. However, include/clang/Sema/Sema.h
> contains an unannotated implicit fallthrough. Since there doesn't seem
> to be a generally-agreed-upon standard annotation for this yet and
> because I would prefer to avoid wrapping the include with pragmas to
> turn the warning off, I suggest changing the code slightly to avoid
> the problem.

Sounds reasonable, since it's just the one change. I've applied your
patch in r183952.

> I attempted to build the rest of Clang with the warning turned on.
> Most of the uncommented fallthroughs look benign, save for one in
> lib/Driver/ToolChains.cpp; I don't think aarch64 should fall through
> to check for mips libraries if aarch64 isn't available.

I don't have enough knowledge of such matters to confirm this;
hopefully someone else will.

More information about the cfe-commits mailing list