OpenAmiga (275/964)

From:Jesse McClusky
Date:11 Sep 2000 at 18:52:01
Subject:Re: AMIOPEN: vpcc complaining...

> From: "artix" <artix@pacbell.net>
>
> Can anyone tell me why vpcc could be having trouble with this:
>
> struct xpr xadd(struct xpr s,struct xpr t, int f)
> {
> unsigned short pe[XDIM+1];
> short e;
>
> /* snip */
>
> *pe=e;
> return *(struct xpr *)pe;
> }
>
> The error I get is on the return statement and looks like this:

<snip>

You're returning a pointer to something that exists only on the stack,
and will be invalid the moment that return executes.

Jesse

Subscribe/Unsubscribe: open-request@amiga.com
Amiga FAQ: http://www.amiga.com/faq.html