home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18294 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  1.6 KB

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