bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnulib's alloca.h used even when there is a system header


From: Eli Zaretskii
Subject: Re: Gnulib's alloca.h used even when there is a system header
Date: Sun, 17 Feb 2019 22:24:08 +0200

> Cc: address@hidden
> From: Paul Eggert <address@hidden>
> Date: Sun, 17 Feb 2019 12:06:53 -0800
> 
> This stuff is rickety, as it's built atop Autoconf's AC_FUNC_ALLOCA and that 
> stuff hasn't changed in at least a decade. In the old days, some alloca 
> implementations were broken and when in doubt it was better to replace the 
> system alloca than to use it. Nowadays I doubt whether it matters much. In 
> any 
> event Autoconf and/or Gnulib patches to be more cautious about replacing 
> alloca.h would be welcome.

Thanks.  I'm currently testing the below, will get back when I'm sure
it's TRT.  But if you think it might not be right for reasons related
to other platforms or some global Gnulib considerations, please tell.

--- gnulib/lib/alloca.h~0       2019-02-17 18:00:40.589250000 +0200
+++ gnulib/lib/alloca.h 2019-02-17 18:22:50.933000000 +0200
@@ -37,7 +37,11 @@
 
 #ifndef alloca
 # ifdef __GNUC__
-#  define alloca __builtin_alloca
+#  if HAVE_ALLOCA_H
+#   include_next <alloca.h>
+#  else
+#   define alloca __builtin_alloca
+#  endif
 # elif defined _AIX
 #  define alloca __alloca
 # elif defined _MSC_VER



reply via email to

[Prev in Thread] Current Thread [Next in Thread]