|
From: | Andreas Vögele |
Subject: | Re: More problems on HP-UX ... 4 |
Date: | Wed, 28 Apr 2004 09:43:24 +0200 |
Kevin Ryde writes:
Andreas Vögele <address@hidden> writes:It seems that alloca.h must be included on HP-UX even when Guile is built with GCC. eval.c: In function `deval': eval.c:2910: warning: implicit declaration of function `alloca'That's odd, it's meant to be a builtin outside of strict c89 or c99 mode.
__builtin_alloca is available but not alloca. Actually, /usr/include/alloca.h contains the following lines on HP-UX: #ifndef alloca # define alloca(x) __builtin_alloca(x) #endif
A #define to __builtin_alloca might be better than alloca.h.
Yes, that's much better than to rely on the fact that GCC and HP's compiler happen to provide the same builtin.
Moreover, it seems that the alloca problem isn't HP specific at all. I also get a warning when I compile the following program under Mac OS X with GCC 3.3 and -Wall:
int main(void) { char *p = alloca (20); *p = 0; return 0; } allocatest.c: In function `main': allocatest.c:4: warning: implicit declaration of function `alloca' What about the following code? #ifndef __GNUC__ ... #else # ifndef alloca # define alloca(x) __builtin_alloca(x) # endif #endif
[Prev in Thread] | Current Thread | [Next in Thread] |