Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!gatech!dcatla!holos0!lbr From: lbr@holos0.uucp (Len Reed) Newsgroups: comp.unix.xenix Subject: Re: Function Prototypes and SCO Xenix-386 C Summary: I was wrong Keywords: C, ANSI Message-ID: <1989Jul31.150944.1103@holos0.uucp> Date: 31 Jul 89 15:09:44 GMT References: <1989Jul27.171720.1948@holos0.uucp> <1391@crdgw1.crd.ge.com> Reply-To: lbr@holos0.UUCP (Len Reed) Distribution: usa Organization: Holos Software, Inc., Atlanta, GA Lines: 38 In article <1989Jul27.171720.1948@holos0.uucp> lbr@holos0.UUCP (Len Reed) (me) writes: > The Xenix-386 cc command will not support function prototypes if I > use -M3 (generate 80386 code). I'm running software development 2.3.0. I mistakenly grouped function prototypes and function definitions, thinking that you had to say either: long function(); /* old-style prototype tells only function type */ . . long function(a, b); /* function definition: args and types separately */ char *a; long b; { /*body*/ } or long function(char *, long); /* ANSI prototype */ . . long function(char *a, long b); /* ANSI function definition */ { /*body*/ } -M2 supports both ANSI prototypes and function definitions. -M3 supports only ANSI prototypes. Function definitions must be given old style. The compiler does support argument type checking, though--if you use an ANSI prototype the argument types given in the old-style function declaration must match. So I have my strong typing--it's just syntacticly a mixed bag. I suppose this resulted from an evolving ANSI standard. Since I went from old K&R to Microsoft C 5.0, I was surprised when I came upon the missing link. -- Len Reed Holos Software, Inc. Voice: (404) 496-1358 UUCP: ...!gatech!holos0!lbr