Implement -Wimplicit-fallthrough (version 9)
Eric Botcazou
ebotcazou@adacore.com
Sat Oct 8 17:04:00 GMT 2016
> testing completed successfully, so I've installed the patch with this
> ChangeLog entry:
>
> 2016-09-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>
> gcc:
> * config/i386/i386.c (ix86_print_operand)
> [HAVE_AS_IX86_CMOV_SUN_SYNTAX]: Add gcc_fallthrough.
> * config/sparc/sparc.c (check_pic): Add fallthrough comment.
> (epilogue_renumber): Likewise.
>
> gcc/ada:
> * gcc-interface/decl.c: Fix fall through comment formatting.
> * gcc-interface/misc.c: Likewise.
> * gcc-interface/trans.c: Likewise.
> * gcc-interface/utils.c: Likewise.
> * gcc-interface/utils2.c: Likewise.
This is a revealing example of how excessive pickiness in warnings can be
counter-productive: after Jakub's latest patches (thanks!) accepting the
original formatting of gcc-interface, I reverted part #2 of the above patch...
only to discover that bootstrap was still broken because of a -Wimplicit-
fallthrough warning, but this time for a missing break:
Index: gcc-interface/utils.c
===================================================================
--- gcc-interface/utils.c (revision 324591)
+++ gcc-interface/utils.c (working copy)
@@ -4289,6 +4289,7 @@ convert (tree type, tree expr)
TREE_TYPE (expr) = type;
return expr;
}
+ break;
case CONSTRUCTOR:
/* If we are converting a CONSTRUCTOR to a mere type variant, or to
So the issue went unnoticed among the slew of false positives the first time
and a genuine error was overlooked...
Tested on x86_64-suse-linux, applied on the mainline.
2016-10-08 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (convert) <VECTOR_CST>: Add missing break.
Revert
2016-09-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc-interface/decl.c: Fix fall through comment formatting.
* gcc-interface/misc.c: Likewise.
* gcc-interface/trans.c: Likewise.
* gcc-interface/utils.c: Likewise.
* gcc-interface/utils2.c: Likewise.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 8817 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161008/8ce61fca/attachment.bin>
More information about the Gcc-patches
mailing list