Thanks for the nice explanation, it confirms how I thought it worked. > Hopefully this explains Neal's confusion about return value rewrites.
Nope. I don't think I had any confusion about how return values are returned. My confusion lies in here: > At Sun, 08 Jul 2007 00:03:10 -0400, Jonathan S. Shapiro wrote: > > If we choose to adopt the "return the return value" convention, it is > > still necessary to handle capability returns specially in C, because the > > caller must say where the incoming capability is to be stored (we cannot > > get compiler help for this from an unmodified compiler). > > How is this different from returning a struct? There is a general > rule of thumb not to return large structs from function calls. > Instead, the convention is for either the function allocates memory or > the caller to pass a pointer to a block of allocated memory. You appear to me to have implied that return by value is somehow normal and that return by reference is not. My observation was that structs are often returned by reference, not by value. I claimed that if you want to generally return structs by value, then there are scenarios where you also need to modify the compiler--just like when returning capabilities by value. Neal _______________________________________________ L4-hurd mailing list [email protected] http://lists.gnu.org/mailman/listinfo/l4-hurd
