clang 10 -Wimplicit-fallthrough

Peter Stuge peter at stuge.se
Sat Jun 6 02:57:54 AEST 2020


Darren Tucker wrote:
> Annotating these points with a FALLTHROUGH macro would make more
> work keeping the code in sync and so is currently a non-starter.

Upstream OpenSSH/OpenBSD has no interest in embracing such a macro?

Isn't there some clang/llvm intent in OpenBSD?


> diff --git a/aclocal.m4 b/aclocal.m4
> index 25ecc49a..fca940dd 100644
> --- a/aclocal.m4
> +++ b/aclocal.m4
> @@ -21,6 +21,11 @@ int main(int argc, char **argv) {
>  	double m = l / 0.5;
>  	long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
>  	printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
> +	switch(i){
> +	case 0: j += i;
> +		/* FALLTHROUGH */
> +	default: j += k;
> +	}

Are you thinking to also add a test case for when it's missing?


//Peter


More information about the openssh-unix-dev mailing list