Related articles |
---|
[15 earlier articles] |
Re: C as assembly language vbdis@aol.com (2001-04-15) |
Re: C as assembly language jim.granville@designtools.co.nz (Jim Granville) (2001-04-18) |
Re: C as assembly language joachim_d@gmx.de (Joachim Durchholz) (2001-05-03) |
Re: C as assembly language joachim_d@gmx.de (Joachim Durchholz) (2001-05-07) |
Re: C as assembly language Hans_Boehm@hp.com (Hans Boehm) (2001-05-07) |
Re: C as assembly language jthorn@galileo.thp.univie.ac.at (2001-05-13) |
Re: C as assembly language david.thompson1@worldnet.att.net (David Thompson) (2001-05-15) |
Re: C as assembly language thp@cs.ucr.edu (2002-03-31) |
From: | "David Thompson" <david.thompson1@worldnet.att.net> |
Newsgroups: | comp.compilers |
Date: | 15 May 2001 00:32:54 -0400 |
Organization: | AT&T Worldnet |
References: | 01-03-006 01-03-046 01-03-130 01-04-027 01-04-052 01-05-021 |
Keywords: | C |
Posted-Date: | 15 May 2001 00:32:54 EDT |
Joachim Durchholz <joachim_d@gmx.de> wrote :
[ returning a struct from a function in C, possibly in registers ]
> 3) What should the caller do with a struct from a result? You can't
> assign it to another struct in C. You can't even take its address. All
> you can do with it is (a) select a member from it (which essentially
> means you're back at a single result) and (b) pass it to another
> function ...
You certainly can assign it -- that's normally the reason
people use a struct return type (to return multiple values),
even on system that don't or can't put it in registers.
You can't take the address of a non-lvalue whether
implemented in register(s) or not.
--
- David.Thompson 1 now at worldnet.att.net
Return to the
comp.compilers page.
Search the
comp.compilers archives again.