
On 2008 Dec 11, at 10:28, Mauricio wrote:
and obviously a C compiler is entitled to return a small struct in registers if it feels like it.
If a compiler is compiling code that calls a library, how is it supposed to know if a return pointer is been passed as a register or by using a pointer? The compiler may not have access to the
The rules are specified as part of an ABI. There is a default ABI for a platform, or you can use a special one (document it). IIRC some CPUs allow information about passed/returned values to be passed in a flag word. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH