diff options
author | Joe Orton <jorton@apache.org> | 2023-01-23 16:34:42 +0000 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2023-01-23 16:34:42 +0000 |
commit | 95ecd122ce03751dd7b05750b9537c0021a706ec (patch) | |
tree | 1c28d779ef91f82f0215a04711b0b7e9d20beb46 | |
parent | fe7ef7f0505bfa6e14ca171237f73b50fdae3c61 (diff) | |
download | apr-95ecd122ce03751dd7b05750b9537c0021a706ec.tar.gz |
* configure.in: Fix variable-length-array detection for recent gcc
with -Wall in CFLAGS, avoiding the "set but not used" warning:
conftest.c: In function 'main':
conftest.c:197:9: error: variable 'foo' set but not used [-Werror=unused-but-set-variable]
197 | int foo[argc];
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906946 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | configure.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 7ad0f5700..b27299256 100644 --- a/configure.in +++ b/configure.in @@ -2305,10 +2305,11 @@ fi AC_SUBST(have_proc_invoked) AC_MSG_CHECKING(for Variable Length Arrays) -APR_TRY_COMPILE_NO_WARNING([], +APR_TRY_COMPILE_NO_WARNING([#include <stdio.h>], [ int foo[argc]; foo[0] = 0; + printf("%d\n", foo[0]); ], vla_msg=yes, vla_msg=no ) AC_MSG_RESULT([$vla_msg]) if test "$vla_msg" = "yes"; then |