You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2023/01/23 16:34:42 UTC
svn commit: r1906946 - /apr/apr/trunk/configure.in
Author: jorton
Date: Mon Jan 23 16:34:42 2023
New Revision: 1906946
URL: http://svn.apache.org/viewvc?rev=1906946&view=rev
Log:
* 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];
Modified:
apr/apr/trunk/configure.in
Modified: apr/apr/trunk/configure.in
URL: http://svn.apache.org/viewvc/apr/apr/trunk/configure.in?rev=1906946&r1=1906945&r2=1906946&view=diff
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Mon Jan 23 16:34:42 2023
@@ -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