alloca() portability

Henry Spencer henry at zoo.toronto.edu
Sun Nov 18 09:18:22 AEST 1990


In article <8789 at scolex.sco.COM> seanf at sco.COM (Sean Fagan) writes:
>Lessee... we've had Chris and Doug denounce alloca(), but I haven't seen
>anything from Henry (yet?  I suspect he would also denounce it)...

Suspicion confirmed.  Alloca() is a kludge that should have died long ago.
There *is* a general problem with the need for various kinds of cleanup on
exiting a function, either by the normal route or by longjmp(), but alloca
solves only one special case of that, at the cost of major portability
problems and new opportunities for interesting bugs.  A proper fix is
impossible without language changes.
-- 
"I don't *want* to be normal!"         | Henry Spencer at U of Toronto Zoology
"Not to worry."                        |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list