home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sdrc!thor!scjones
- From: scjones@thor.sdrc.com (Larry Jones)
- Newsgroups: comp.lang.c
- Subject: Re: Calling convention: C vs PASCAL
- Message-ID: <2390@sdrc.COM>
- Date: 13 Dec 92 18:54:36 GMT
- References: <1992Dec11.225756.26780@eng.ufl.edu> <7NJoVB1w165w@quest.UUCP>
- Sender: news@sdrc.COM
- Lines: 22
-
- In article <7NJoVB1w165w@quest.UUCP>, kdq@quest.UUCP (Kevin D. Quitt) writes:
- > A quick question to others: It has always been "common knowledge"
- > that these two things are at the heart of C (right-to-left pushing and
- > the caller clearing the stack). I've read the ANSI standard, but I
- > couldn't find a mention of these things. I assume it's got to be
- > there, but where?
-
- Those things are at the heart of most common implementations of C, but
- they certainly aren't fundamental to the language. For example, the
- official Vax calling conventions place the size of the stack frame at
- the very beginning of the frame so the callee CAN pop the stack frame
- rather than the caller. Similarly, there's no reason an implementation
- couldn't push the arguments left-to-right as long as the callee has a
- way to find the first argument (if the callee doesn't have a variable
- argument list, this is quite simple). The C Standard only specifies
- how an implementation must behave, not the details of how to produce
- that behavior. As long an implementation can produce code that works
- correctly, what difference does it make?
- ----
- Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070
- larry.jones@sdrc.com or ...uunet!sdrc!larry.jones
- It's SUSIE! It's a GIRL! Santa would understand! -- Calvin
-