Re: "standard" C calling convention?

"Glen Herrmannsfeldt" <gah@ugcs.caltech.edu>
24 Feb 2003 14:26:24 -0500

          From comp.compilers

Related articles
[6 earlier articles]
Re: "standard" C calling convention? christian.bau@cbau.freeserve.co.uk (Christian Bau) (2003-02-21)
Re: "standard" C calling convention? mgl8@attbi.com (Mike Ludwig) (2003-02-21)
Re: "standard" C calling convention? sander@haldjas.folklore.ee (Sander Vesik) (2003-02-21)
Re: "standard" C calling convention? andrew.higham@blueyonder.co.uk (Andrew) (2003-02-21)
Re: "standard" C calling convention? nmm1@cus.cam.ac.uk (2003-02-24)
Re: "standard" C calling convention? nmm1@cus.cam.ac.uk (2003-02-24)
Re: "standard" C calling convention? gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-02-24)
Re: "standard" C calling convention? marcov@toad.stack.nl (Marco van de Voort) (2003-02-24)
Re: "standard" C calling convention? marcov@stack.nl (2003-03-09)
Re: "standard" C calling convention? mgl8@attbi.com (Mike Ludwig) (2003-03-09)
Re: "standard" C calling convention? nmm1@cus.cam.ac.uk (2003-03-14)
| List of all articles for this month |

From: "Glen Herrmannsfeldt" <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: 24 Feb 2003 14:26:24 -0500
Organization: AT&T Broadband
References: 03-02-072 03-02-086 03-02-091
Keywords: C
Posted-Date: 24 Feb 2003 14:26:24 EST

"Christian Bau" <christian.bau@cbau.freeserve.co.uk> wrote in message
news:03-02-091@comp.compilers...
> > Well, many OS have somewhat of a standard, and C programs on that OS
> > may or may not use it. C requires the ability to call with a variable
> > number of arguments, which restricts somewhat the allowable calling
> > conventions
(snip)


> C requires that ability only for calls to functions that are declared to
> have a variable number of arguments. On a PowerPC, calling f (3) will
> generate very different code if f is declared to take one argument or
> declared to take a variable number of arguments.


Probably you are right. I don't believe this was true in K&R
(pre-ANSI) C, and for backward compatibility C compilers wouldn't
require it. For implementations on machines that existed before ANSI
C, the calling convention would have been established, and there is
resistance to change. (Backwards compatibility again.) For newer
machines, where a calling convention didn't exist yet and K&R
compatibility isn't required, that may be reasonable.


-- glen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.