bug-guile
[Top][All Lists]
Advanced

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

bug#11845: guile-1.8.8 segfaults at build-time with gcc-4.6.3 and -O3


From: Ludovic Courtès
Subject: bug#11845: guile-1.8.8 segfaults at build-time with gcc-4.6.3 and -O3
Date: Tue, 03 Jul 2012 12:07:47 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux)

Hi Cyprien,

Cyprien Nicolas <address@hidden> skribis:

> That define value is computed using the find_stack_direction function
> defined in configure.in:
>
> int
> find_stack_direction ()
> {
>   static char *addr = 0;
>   auto char dummy;
>   if (addr == 0)
>     {
>       addr = &dummy;
>       return find_stack_direction ();
>     }
>   else
>     return (&dummy > addr) ? 1 : -1;
> }
>
> int
> main ()
> {
>   return find_stack_direction () < 0;
> }

Guile 2.0 uses this instead:

--8<---------------cut here---------------start------------->8---
int
find_stack_direction (int *addr, int depth)
{
  int dir, dummy = 0;
  if (! addr)
    addr = &dummy;
  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
  return dir + dummy;
}

int
main (int argc, char **argv)
{
  return find_stack_direction (0, argc + !argv + 20) < 0;
}
--8<---------------cut here---------------end--------------->8---

Can you check whether it works for you?

(See also
<http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00041.html>
on that topic.)

Thanks,
Ludo’.





reply via email to

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