tech-userlevel archive

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

Re: Adding <alloca.h> ?

> If some software expects an <alloca.h> but the base OS does not
> provide it, then is it more useful to have a devel/alloca package
> which can be buildlinked which would provide it?

I'm not sure whether that can be done even in principle.  I don't
really understand alloca all that well, but my impression is that it
works by fiddling the stack pointer, and, as such, really needs to be a
compiler builtin.  On some architectures, yes, stack and frame pointers
may be separate and the compiler may be nice enough to generate code
that tolerates a routine returning with the stack pointer moved.  But
that does not sound to me like anything to count on.

Could someone check (and, if appropriate, correct) my understanding?

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index