Function Prototypes and SCO Xenix-386 C

Len Reed lbr at holos0.uucp
Tue Aug 1 01:09:44 AEST 1989


In article <1989Jul27.171720.1948 at holos0.uucp> lbr at 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



More information about the Comp.unix.xenix mailing list