[cfe-commits] [PATCH] "Soft opt-in" option for -Wimplicit-fallthrough

Alexander Kornienko alexfh at google.com
Fri May 25 16:33:02 PDT 2012


Hi cfe-commits,

This patch adds a "soft opt-in" option for
-Wimplicit-fallthroughdiagnostics. The reason for it is to provide a
way to start using
fall-through annotations without breaking (when treating warnings as
errors) all code with unannotated fall-throughs. So it's only meant to be
used for large code bases during a transition phase prior to turning on
-Wimplicit-fallthrough.

This mode is controlled with -Wimplicit-fallthrough-per-method diagnostic
option (implies -Wimplicit-fallthrough). It enables switch cases
fall-through diagnostic only for methods which contain at least one
fall-through annotation. This will allow to fix 'unannotated fall-through'
warnings method-by-method and will help to avoid regressions in all
methods, where fall-through annotations were already added.

This mode will probably be not very helpful for finding real bugs, but it
will help to go smoothly through a transition period before switching on
the real diagnostic.

Please review this patch.
Thank you!

-- 
Best regards,
Alexander Kornienko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120526/17197d80/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: implicit-fallthrough-per-method.diff
Type: application/octet-stream
Size: 4324 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120526/17197d80/attachment.obj>


More information about the cfe-commits mailing list