Re: [cc65] returning structs

From: Ullrich von Bassewitz <>
Date: 2009-08-10 15:34:37

On Sun, Aug 09, 2009 at 09:11:00PM -0500, Scott Hutter wrote:
> I know that you cant return a struct by value.  Is there any way around
> this?  If I return a pointer to the struct, the values are lost upon leaving
> the function.  Can anyone provide an example workaround?

It's not only that you can't, it's also that you should really consider doing
it on small 6502 based platforms. There's a certain overhead involved for
creating copies of structs, and just passing a pointer is often much more

Besides that, it would of course be desirable for cc65 to support passing and
returning structs. There are (rare) cases where it's useful and it's one more
issue where cc65 is not conforming.



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Aug 10 15:36:27 2009

This archive was generated by hypermail 2.1.8 : 2009-08-10 15:36:29 CEST