From: Cheyenne Wills Date: Thu, 16 Jul 2020 21:07:15 +0000 (-0600) Subject: autoconf: fix detection for fallthrough attribute X-Git-Tag: openafs-devel-1_9_0~31 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=899b1af4183fb09fd55a36e3d10ffbdb9671a47e autoconf: fix detection for fallthrough attribute Due to bug , ax_gcc_func_attribute.m4 fails to properly detect __attribute__((fallthrough)) in clang. Until this is fixed in autoconf-archive upstream, fix our local copy of ax_gcc_func_attribute.m4, so we can detect __attribute__((fallthrough)) to make --enable-checking work with clang. Change-Id: I80a4557384f8e1438344e48bfe722e20c8773882 Reviewed-on: https://gerrit.openafs.org/14273 Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/cf/ax_gcc_func_attribute.m4 b/src/cf/ax_gcc_func_attribute.m4 index 098c9aa..30bf4c1 100644 --- a/src/cf/ax_gcc_func_attribute.m4 +++ b/src/cf/ax_gcc_func_attribute.m4 @@ -77,7 +77,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 9 +#serial 9 with local fix for fallthrough attribute AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) @@ -132,7 +132,7 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ int foo( void ) __attribute__(($1)); ], [fallthrough], [ - int foo( void ) {switch (0) { case 1: __attribute__(($1)); case 2: break ; }}; + void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }}; ], [flatten], [ int foo( void ) __attribute__(($1));