Re: "standard" C calling convention?

"Glen Herrmannsfeldt" <>
13 Feb 2003 00:48:59 -0500

          From comp.compilers

Related articles
"standard" C calling convention? (Peter Seibel) (2003-02-12)
Re: "standard" C calling convention? (2003-02-13)
Re: "standard" C calling convention? (2003-02-13)
Re: "standard" C calling convention? (Glen Herrmannsfeldt) (2003-02-13)
Re: "standard" C calling convention? (2003-02-13)
Re: "standard" C calling convention? (Dennis Ritchie) (2003-02-21)
Re: "standard" C calling convention? (Christian Bau) (2003-02-21)
Re: "standard" C calling convention? (Mike Ludwig) (2003-02-21)
Re: "standard" C calling convention? (Sander Vesik) (2003-02-21)
Re: "standard" C calling convention? (Andrew) (2003-02-21)
[7 later articles]
| List of all articles for this month |

From: "Glen Herrmannsfeldt" <>
Newsgroups: comp.compilers
Date: 13 Feb 2003 00:48:59 -0500
Organization: AT&T Broadband
References: 03-02-072
Keywords: C, standards
Posted-Date: 13 Feb 2003 00:48:58 EST

"Peter Seibel" <> wrote in message
> People often refer to the "standard C calling convention", usually as
> opposed to some other calling convention that a compiler also
> supports. I have several questions, in no particular order about this
> "standard".
> - Am I correct in assuming that this is more of an de facto than de
> jure standard.

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. (x86 has hardware support for a calling convention in
which the called routine removes arguments from the stack. This is
sometimes called the Pascal convention, and doesn't work well for C.)

It is desirable to be able to call between different languages.
Sometimes that requires C programs to pass the address of a variable
instead of the value as C normally would do.

-- glen

Post a followup to this message

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