Xref: utzoo comp.lang.c:8476 comp.sys.ibm.pc:13580 Path: utzoo!mnetor!uunet!portal!cup.portal.com!Devin_E_Ben-Hur From: Devin_E_Ben-Hur@cup.portal.com Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: C declaration styles Message-ID: <4061@cup.portal.com> Date: 23 Mar 88 07:45:17 GMT References: <5699@watdragon.waterloo.edu> <1065@sask.UUCP> <1465@ur-tut.UUCP> Organization: The Portal System (TM) Lines: 21 XPortal-User-Id: 1.1001.3645 >hwfeccess@uorvm.bitnet (Harlen Fienstein) writes: >coleman@sask.UUCP (Geoff Coleman @ College of Engineering) writes: >>> >>> void foo(int x, double y) >> >> Could you please tell us what kind of PC (if not an MS-DOS) >>and what kind of compiler you ate using. The above isn't Lattice >>or Microsoft and I would be suprised if it is Turbo. >> > >Sure enough, you shall be surprised. That's Turbo C syntax. It will also >accept the more commonly acceptable method of argument syntax, but you have >the option of doing it the above way. I use the style illustrated here, as >it's easier for me to remember, having done most of my C work with Turbo C. More significantly, it is Draft ANSI C. And the latest releases of MSC and Lattice do support the function prototype declaration style. There are significant advantages to this style -- parameter type checking (and implied type promotion) and better code generation by avoiding normal parameter type promotion (chars pushed as chars, not ints; floats instead of doubles).