Re: Statement expression with function-call variable lifetime

2005-06-29 Thread Shaun Jackman
On 6/29/05, Russell Shaw <[EMAIL PROTECTED]> wrote: > Alloca is like creating a stack variable, except it just gives you some > generic bytes that don't mean anything. Exiting the local scope will > trash the local variables and anything done with alloca(). You'll need > to store some information i

Re: Statement expression with function-call variable lifetime

2005-06-29 Thread Russell Shaw
Shaun Jackman wrote: Hello, I'm implementing a tiny vfork/exit implementation using setjmp and longjmp. Since the function calling setjmp can't return (if you still want to longjmp to its jmp_buf) I implemented vfork using a statement expression macro. Here's my implementation of vfork. jmp_buf

Re: Statement expression with function-call variable lifetime

2005-06-29 Thread Shaun Jackman
On 6/29/05, Daniel Jacobowitz <[EMAIL PROTECTED]> wrote: > On Wed, Jun 29, 2005 at 10:34:20AM -0700, Shaun Jackman wrote: > > the statement expression macro? My best idea was to use alloca, but it > > wouldn't look pretty. Can someone confirm that memory allocated with > > alloca would last the lif

Re: Statement expression with function-call variable lifetime

2005-06-29 Thread Daniel Jacobowitz
On Wed, Jun 29, 2005 at 10:34:20AM -0700, Shaun Jackman wrote: > the statement expression macro? My best idea was to use alloca, but it > wouldn't look pretty. Can someone confirm that memory allocated with > alloca would last the lifetime of the function call, and not the > lifetime of the stateme

Statement expression with function-call variable lifetime

2005-06-29 Thread Shaun Jackman
Hello, I'm implementing a tiny vfork/exit implementation using setjmp and longjmp. Since the function calling setjmp can't return (if you still want to longjmp to its jmp_buf) I implemented vfork using a statement expression macro. Here's my implementation of vfork. jmp_buf *vfork_jmp_buf; #defin