Normally, gcc translates calls to alloca by inlined code. This is
not done when either the -ansi or the -fno-builtin option is given. But
beware! By default the glibc version of <stdlib.h> includes
<alloca.h> and that contains the line
# define alloca(size) __builtin_alloca
with messy consequences if one has a private version of this function.
The fact that the code is inlined, means that it is impossible to take the
address of this function, or to change its behaviour by linking with a
The inlined code often consists of a single instruction adjusting the stack
pointer, and does not check for stack overflow. Thus, there is no NULL error
The alloca function is machine and compiler dependent. On many systems
its implementation is buggy. Its use is discouraged.
On many systems alloca cannot be used inside the list of arguments of a
function call, because the stack space reserved by alloca would appear
on the stack in the middle of the space for the function arguments.