Problem with stack-detection code reported by Andy Wingo in
<http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00032.html>.
This fix is imported from gnulib's c-stack module.
2011-06-18 Paul Eggert <eggert@cs.ucla.edu>
+ * lib/autoconf/functions.m4 (_AC_LIBOBJ_ALLOCA): Try to outsmart GCC.
+ Problem with stack-detection code reported by Andy Wingo in
+ <http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00032.html>.
+ This fix is imported from gnulib's c-stack module.
+
* doc/autoconf.texi (File Descriptors): Fix texinfo typo.
2011-06-14 Eric Blake <eblake@redhat.com>
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[AC_INCLUDES_DEFAULT
int
-find_stack_direction ()
+find_stack_direction (char *addr)
{
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
+ char dummy;
+ return (! addr ? find_stack_direction (&dummy)
+ : addr < &dummy ? 1 : -1);
}
int
-main ()
+main (void)
{
- return find_stack_direction () < 0;
+ return find_stack_direction (0) < 0;
}])],
[ac_cv_c_stack_direction=1],
[ac_cv_c_stack_direction=-1],