[openssh-commits] [openssh] 01/01: Test fallthrough in OSSH_CHECK_CFLAG_COMPILE.

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jun 5 13:22:00 AEST 2020


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 8da801f585dd9c534c0cbe487a3b1648036bf2fb
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Fri Jun 5 13:20:10 2020 +1000

    Test fallthrough in OSSH_CHECK_CFLAG_COMPILE.
    
    clang 10's -Wimplicit-fallthrough does not understand /* FALLTHROUGH */
    comments and we don't use the __attribute__((fallthrough)) that it's
    looking for.  This has the effect of turning off -Wimplicit-fallthrough
    where it does not currently help (particularly with -Werror).  ok djm@
---
 aclocal.m4 | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/aclocal.m4 b/aclocal.m4
index 25ecc49a..0193c3dc 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -21,6 +21,16 @@ 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);
+	/*
+	 * Test fallthrough behaviour.  clang 10's -Wimplicit-fallthrough does
+	 * not understand comments and we don't use the "fallthrough" attribute
+	 * that it's looking for.
+	 */
+	switch(i){
+	case 0: j += i;
+		/* FALLTHROUGH */
+	default: j += k;
+	}
 	exit(0);
 }
 	]])],

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list