Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!bionet!apple!vsi1!daver!mips!rogerk From: rogerk@mips.COM (Roger B.A. Klorese) Newsgroups: comp.unix.wizards Subject: Re: system 5 vrs. bsd4.3 question Message-ID: <26969@abbott.mips.COM> Date: 6 Sep 89 16:10:17 GMT References: <28398@beta.lanl.gov> <454@odin.SGI.COM> Reply-To: rogerk@mips.COM (Roger B.A. Klorese) Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 17 In article <454@odin.SGI.COM> gavin@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@mips.COM {ames,decwrl,pyramid}!mips!rogerk "I want to live where it's always Saturday." -- Guadalcanal Diary