On 10/25/2010 07:58 PM, Paul Eggert wrote:
On 10/25/10 03:09, Paolo Bonzini wrote:
Maybe this could use "func (n, alloca (INT_BUFSIZE_BOUND (t)))" if C99
is not in use?
No, alas, because on some hosts, alloca cannot be used within an
argument to a call. This is because alloca messes with the stack
pointer at the same time that the compiler is pushing things onto the
stack. This is documented in gnulib's lib/alloca.in.h.
Ugh, makes sense.
For C89 compilers, possibly we could detect at compile time whether
it's safe to call alloca from within a function's argument. (Is this
safe in GCC?
I can take a look at the code, it is definitely safe with GCC 4 and
-fno-tree-ter.
Paolo