tech-userlevel archive

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

Re: alloca again



> I'd argue that providing alloca(3) as anything except a compiler
> builtin is a bug, and that kind of thing should never be used.

I'd argue that alloca should never be used and actually should never
have existed.  As far as I can see it does nothing that can't be done
better - more portably and correctly - by variable-sized arrays.  Am I
missing something?

> Is there any reason we don't simplify this in the headers -
> __builtin_alloca(size) seems to work with every compiler?

It's not part of the language, so "work with every compiler" is, at
best, a heuristic approximation, and is fragile, liable to be broken by
the next compiler to come along.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index