[gfortran,PATCH] alloca() is undeclared in env.c

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Sep 16 17:14:00 GMT 2004


On Thu, Sep 16, 2004 at 06:07:37PM +0100, Paul Brook wrote:
> > 2004-09-16  Steven G. Kargl  <kargls@comcast.net>
> >
> >          * intrinsics/env.c: Use __builtin_alloca(x).
> >
> > +#ifdef alloca
> > +#undef alloca
> > +#define alloca(x)  __builtin_alloca(x)
> > +#endif 
> 
> Won't this break targets which don't define alloca in stdlib.h?
> My suggestion would be to move the #define after the #endif
> 

Yes, you're right.

I was wondering if we want to put

#define gfc_alloca(x) __builtin_alloca(x)

in libgfortran.h.  This would paper over the issue of 
alloc() being declared in potentially different system
headers and other parts of the library may benefit 
from alloca().


-- 
Steve



More information about the Fortran mailing list