cdecl keyword

Skizofrenio the Elder...Younger bobmon at silver.bacs.indiana.edu
Sun Apr 3 00:40:22 AEST 1988


Barry Margolin proposes that all language-compilers (on a given architecture,
perhaps) could internally handle function-calling in the same manner.  But
that means that no language would be as efficient as it could be.  In parti-
cular, Pascal can check some things at compile-time by forbidding options
such as variable-length parameter lists.  Who would want to write a Pascal
compiler that has to silently add back in the functionality to decide how
many arguments are being received?  (Turbo C goes the other way, and allows
"Pascal-type" declarations for functions with a fixed number of arguments.
Then you have to be sure that your standard library calls are forced to
"C-type" anyway.  They don't recommend all this for beginners.)

On another level, I assume (no, I don't know) that C has a standard for
whether the caller or the callee saves working registers.  How could you
internally adjust for another language with a conflicting standard?  Other
than by a programmer-specified switch that says "violate the standard at this
point"?

disclaimer:  If I knew what I was talking about, I probably wouldn't bother
to say anything.



More information about the Comp.lang.c mailing list