lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <748935.1606147853@warthog.procyon.org.uk>
Date:   Mon, 23 Nov 2020 16:10:53 +0000
From:   David Howells <dhowells@...hat.com>
To:     Joe Perches <joe@...ches.com>
Cc:     dhowells@...hat.com, "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        linux-afs@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH 001/141] afs: Fix fall-through warnings for Clang

Joe Perches <joe@...ches.com> wrote:

> >  		call->unmarshall++;
> > +
> > +		fallthrough;
> 
> My preference would be to change these to break and not fallthrough;
> 
> >  	case 5:
> >  		break;
> >  	}

My preference would be to fall through.  The case number is the state machine
state, as indexed by call->unmarshall.  All the other cases in the switch fall
through.

I would also generally prefer that the fallthrough statement occur before the
blank line, not after it, since it belongs with the previous clause, and not
between a comment about a case statement and its associated case statement,
i.e.:

		afs_extract_to_tmp(call);
		call->unmarshall++;

		/* extract the callback array and its count in two steps */
		fallthrough;
	case 3:

would be better written as:

		afs_extract_to_tmp(call);
		call->unmarshall++;
		fallthrough;

		/* extract the callback array and its count in two steps */
	case 3:

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ