Xref: utzoo comp.lang.c:9484 comp.sys.ibm.pc:14649 Path: utzoo!mnetor!uunet!husc6!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: cdecl keyword ( re: C Decl ... ) Message-ID: <2820@mmintl.UUCP> Date: 18 Apr 88 21:34:47 GMT References: <1238@wjvax.UUCP> <297@ho7cad.ATT.COM> <1242@wjvax.UUCP> <121@csanta.UUCP> <146@obie.UUCP> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Ashton-Tate Corporation, East Hartford Development Center Lines: 26 In article <146@obie.UUCP> wes@obie.UUCP (Barnacle Wes) writes: >So why should we force these MS-DOSisms on the rest of the C-speaking >world? ... If your programming environment needs them, let >them be (non-portable) extensions to the standard needed to support >your operating system! That's exactly what they are! I didn't hear anybody suggesting that they be standardized; the question that brought about the whole discussion was how to use them in the MS-DOS environment. It is true that, with the (proposed) ANSI standard, one could define a calling convention for C on the 8086 which was as efficient as the Pascal standard: namely, callee pops arguments for fixed argument list functions, and caller pops for variadic functions. But the C calling convention for the machine antedates the ANSI standard; and with K&R C, the calling program does not know whether a function is variadic. Thus, there are good reasons for providing the pascal convention as a compilation default; and this necessitates a cdecl keyword. (Yes, one *could* redefine the calling interface. This would invalidate a lot of existing code -- assembler routines are quite common in 8086 products.) -- Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Ashton-Tate 52 Oakland Ave North E. Hartford, CT 06108