This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Implement -Wimplicit-fallthrough (take 2): the rest
- From: Michael Matz <matz at suse dot de>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 4 Aug 2016 14:36:59 +0200 (CEST)
- Subject: Re: Implement -Wimplicit-fallthrough (take 2): the rest
- Authentication-results: sourceware.org; auth=none
- References: <20160727165538.GY7007@redhat.com>
Hi,
On Wed, 27 Jul 2016, Marek Polacek wrote:
> And this is the rest. Either I just adjusted a falls through comment,
> or I added __builtin_fallthrough (). These were the cases where I was
> fairly sure that the fall through is intentional.
I saw one case where I think the warning is a bit over-active:
@@ -42072,6 +42089,7 @@ rdseed_step:
case IX86_BUILTIN_ADDCARRYX64:
icode = CODE_FOR_addcarrydi;
mode0 = DImode;
+ gcc_fallthrough ();
handlecarry:
arg0 = CALL_EXPR_ARG (exp, 0); /* unsigned char c_in. */
I.e. it also warns if the following label is not a case label but a normal
one. I don't think this counts as a classical fall-through and it IMHO
should not be warned about nor should it be marked.
Ciao,
Michael.