system 5 vrs. bsd4.3 question

Gavin A. Bell gavin at krypton.sgi.com
Wed Sep 6 03:07:14 AEST 1989


dxk at beta.lanl.gov (David M Koon) writes:

>I am trying to port the following code from a Sun( it also works 
>on a PC with turbo C) to a Silicon Graphics(system V).

>#include "cffs.h"
> 
>main(argc,argv)

There was a question exactly like this a couple of months ago.  Look
for a missing semicolon at the end of cffs.h

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.
This probably isn't unreasonable, since main() should always be
declared either   void   or   int.

This has nothing to do with SYSV versus BSD.

--gavin



More information about the Comp.unix.wizards mailing list