diff options
author | Cheyenne Wills <cheyenne.wills@gmail.com> | 2020-05-19 11:05:28 -0600 |
---|---|---|
committer | Cheyenne Wills <cheyenne.wills@gmail.com> | 2020-05-20 08:32:23 -0600 |
commit | 083716b47c8a95dda5a58362ccd3e04021c743a5 (patch) | |
tree | b347844cdee5f3e54a3d9e7d72a45981d91add07 /m4/ax_gcc_func_attribute.m4 | |
parent | 90814f1895435ee3aa077e0880bd6aa49bf14ec3 (diff) | |
download | autoconf-archive-083716b47c8a95dda5a58362ccd3e04021c743a5.tar.gz |
ax_gcc_func_attribute.m4: test fails for the fallthrough attribute with clang
The test for the fallthrough attribute fails due to other compiler
warnings when using clang. The following warnings are generated:
warning: no case matching constant switch condition '0'
warning: control reaches end of non-void function [-Wreturn-type]
Because of these additional warnings, the test always results in a
failure for the fallthrough attribute.
Update ax_gcc_func_attribute.m4 to eliminate the warnings that are
masking the test for the fallthrough attribute.
Note, tested the entire suite of attribute tests using clang and only
the fallthrough test contained warnings that caused the test to fail.
Diffstat (limited to 'm4/ax_gcc_func_attribute.m4')
-rw-r--r-- | m4/ax_gcc_func_attribute.m4 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/ax_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4 index da2b1ac..fa4e089 100644 --- a/m4/ax_gcc_func_attribute.m4 +++ b/m4/ax_gcc_func_attribute.m4 @@ -78,7 +78,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 12 +#serial 13 AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) @@ -133,7 +133,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)); |