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

Luke Zarko zarko at google.com
Thu Jun 13 14:37:39 PDT 2013


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.

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-toolchains.patch
Type: application/octet-stream
Size: 771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130613/f4e169f6/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sema-fallthrough.patch
Type: application/octet-stream
Size: 788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130613/f4e169f6/attachment-0001.obj>


More information about the cfe-commits mailing list