C declaration styles

Devin_E_Ben-Hur at cup.portal.com Devin_E_Ben-Hur at cup.portal.com
Wed Mar 23 17:45:17 AEST 1988


>hwfeccess at uorvm.bitnet (Harlen Fienstein) writes:
>coleman at 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).



More information about the Comp.lang.c mailing list