changing the console; alloca missing from 9021?

jim frost madd at world.std.com
Tue Aug 7 12:28:52 AEST 1990


guy at auspex.auspex.com (Guy Harris) writes:
>Yes, but Sun (for SPARC) and, I think, MIPS hide the help they give the
>compiler (a #define, rather than a #pragma, in Sun's case) in an include
>file <alloca.h>;

On the MIPS architecture alloca is a bitch to do -- a stack frame
*cannot* change size.  The DECstation doesn't even have a real alloca,
but instead uses malloc.  Calls to alloca with a zero argument free
everything allocated with alloca.  I have a similar function that I
sometimes use on machines that have a broken alloca.  I haven't looked
at the MIPS stuff close enough to tell if they do the same as DEC but
I wouldn't be at all surprised.

It would have been nice for IBM to have hidden the #pragma and it
would also have been nice for them to allow it at any place outside of
a function.  Unfortunately they didn't, too bad, but in my experience
this won't be the worst problem you come across when porting code
written by people who think alloca is portable.

Happy hacking,

jim frost
saber software
jimf at saber.com



More information about the Comp.unix.aix mailing list