svn commit: r1927742 - in apr/apr/trunk: . build poll/unix

[email protected]
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <175489777256.1787573.15110061989303140762@svn02-us-east.apache.org>
Author: jorton
Date: Mon Aug 11 07:36:12 2025
New Revision: 1927742

Log:
* configure.in: Use standard autoconf macro AC_C_VARARRAYS
  for detecting VLA support.

* poll/unix/poll.c (apr_poll): Use HAVE_C_VARRARYS not HAVE_VLA.

* build/buildcheck.sh: Bump required autoconf to 2.61 (released 2006-11-17)

Github: pr #68

Modified:
   apr/apr/trunk/build/buildcheck.sh
   apr/apr/trunk/configure.in
   apr/apr/trunk/poll/unix/poll.c

Modified: apr/apr/trunk/build/buildcheck.sh
==============================================================================
--- apr/apr/trunk/build/buildcheck.sh	Mon Aug 11 06:45:02 2025	(r1927741)
+++ apr/apr/trunk/build/buildcheck.sh	Mon Aug 11 07:36:12 2025	(r1927742)
@@ -15,11 +15,11 @@ else
   echo "buildconf: python version $py_version (ok)"
 fi
 
-# autoconf 2.59 or newer
+# autoconf 2.61 or newer
 ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|sed -e 's/^[^0-9]*//;s/[a-z]* *$//;q'`
 if test -z "$ac_version"; then
   echo "buildconf: autoconf not found."
-  echo "           You need autoconf version 2.59 or newer installed"
+  echo "           You need autoconf version 2.61 or newer installed"
   echo "           to build APR from SVN."
   res=1
 else

Modified: apr/apr/trunk/configure.in
==============================================================================
--- apr/apr/trunk/configure.in	Mon Aug 11 06:45:02 2025	(r1927741)
+++ apr/apr/trunk/configure.in	Mon Aug 11 07:36:12 2025	(r1927742)
@@ -1831,6 +1831,7 @@ AC_TYPE_UID_T
 AC_CHECK_TYPE(ssize_t, int)
 AC_C_INLINE
 AC_C_CONST
+AC_C_VARARRAYS
 AC_FUNC_SETPGRP
 
 APR_CHECK_SOCKLEN_T
@@ -2418,18 +2419,6 @@ fi
 
 AC_SUBST(have_proc_invoked)
 
-AC_MSG_CHECKING(for Variable Length Arrays)
-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
-    AC_DEFINE(HAVE_VLA, 1, [Define if C compiler supports VLA])
-fi
-
 AC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[
 AC_TRY_RUN([
 #include <sys/types.h>

Modified: apr/apr/trunk/poll/unix/poll.c
==============================================================================
--- apr/apr/trunk/poll/unix/poll.c	Mon Aug 11 06:45:02 2025	(r1927741)
+++ apr/apr/trunk/poll/unix/poll.c	Mon Aug 11 07:36:12 2025	(r1927742)
@@ -73,7 +73,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_p
                                    apr_interval_time_t timeout)
 {
     int i, num_to_poll;
-#ifdef HAVE_VLA
+#ifdef HAVE_C_VARARRAYS
     /* XXX: I trust that this is a segv when insufficient stack exists? */
     struct pollfd pollset[num + 1]; /* +1 since allocating 0 is undefined behaviour */
 #elif defined(HAVE_ALLOCA)
@@ -130,7 +130,7 @@ APR_DECLARE(apr_status_t) apr_poll(apr_p
         }
     }
 
-#if !defined(HAVE_VLA) && !defined(HAVE_ALLOCA)
+#if !defined(HAVE_C_VARARRAYS) && !defined(HAVE_ALLOCA)
     if (num > SMALL_POLLSET_LIMIT) {
         free(pollset);
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.