9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: jmk@plan9.bell-labs.com
To: russcox@gmail.com, 9fans@cse.psu.edu
Subject: Re: [9fans] return vlong
Date: Fri, 20 May 2005 11:07:44 -0400	[thread overview]
Message-ID: <3658b755213322c8dfc67a2ccb692cca@plan9.bell-labs.com> (raw)
In-Reply-To: <ee9e417a050520080026bea02b@mail.gmail.com>

that's on the 386. other architectures may return the value
in one or two registers.

On Fri May 20 11:01:27 EDT 2005, russcox@gmail.com wrote:
> a call to a function that returns a vlong or structure
> passes an invisible (to the c programmer) first argument
> that is a pointer to somewhere to write the return value.
> so the following two functions have equivalent assembly
> (but different c types):
> 
> vlong
> return0(void)
> {
>     return 0;
> }
> 
> void
> return0(vlong *v)
> {
>     *v = 0;
> }
> 
> russ


  reply	other threads:[~2005-05-20 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-20 14:53 Sergey Reva
2005-05-20 15:00 ` Russ Cox
2005-05-20 15:07   ` jmk [this message]
2005-05-20 15:15 ` C H Forsyth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3658b755213322c8dfc67a2ccb692cca@plan9.bell-labs.com \
    --to=jmk@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    --cc=russcox@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).