system 5 vrs. bsd4.3 question

Roger B.A. Klorese rogerk at mips.COM
Thu Sep 7 02:10:17 AEST 1989


In article <454 at odin.SGI.COM> gavin at krypton.sgi.com (Gavin A. Bell) writes:
>A missing semicolon probably make the code look like:
>struct foo {...} main(argc,argv) { ... }
>... that is, main is a 'struct foo'.  Most compilers don't care, but
>the Mips compiler used on SGI machines seems to get quite confused.

It doesn't get confused; it simply uses a different format for the
parameter list when functions return struct.  A dummy first entry is
added to hold the address of an instance of the appropriate struct
into which the return value is placed.  Unfortunately, the startup
code, which always calls "main" as an int function, expects argc to
be there.
-- 
ROGER B.A. KLORESE      MIPS Computer Systems, Inc.      phone: +1 408 720-2939
928 E. Arques Ave.  Sunnyvale, CA  94086                        rogerk at mips.COM
{ames,decwrl,pyramid}!mips!rogerk
"I want to live where it's always Saturday."  -- Guadalcanal Diary



More information about the Comp.unix.wizards mailing list