Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!ucbvax!agate!bionet!csd4.milw.wisc.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cmcl2!phri!marob!daveh From: daveh@marob.MASA.COM (Dave Hammond) Newsgroups: comp.unix.xenix Subject: Re: SCO XENIX bug prevents smail from working correctly. Message-ID: <469@marob.MASA.COM> Date: 20 Jan 89 13:16:49 GMT References: <31@elgar.UUCP> Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC New York City Lines: 44 In article <31@elgar.UUCP> ag@elgar.UUCP (Keith Gabryelski) writes: >The SCO XENIX C compiler (mine is version 2.2) does not handle a >return from main() correctly. A return from main should be the same >as an exit from main. It isn't. >You can confirm this by compiling, running, and checking the exit >status of: > main(){ return 0; } >and > main(){ exit(0); } >(On my machine, a 386 box running 2.3.1 OS and 2.2 dev system >The former's exit status is 1. The latter's exit status is 0. Hmmm ... [ tested on a SCO 386 box, 2.3.1 OS, 2.2 DS ] $ echo "main(){exit(0);}" >foo.c $ cc foo.c $ a.out $ echo $? $ 0 $ echo "main(){return(0);}" >foo.c $ cc foo.c $ a.out $ echo $? $ 0 $ echo "main(){exit(1);}" >foo.c $ cc foo.c $ a.out $ echo $? $ 1 $ echo "main(){return(1);}" >foo.c $ cc foo.c $ a.out $ echo $? $ 1 Hmmm ... [BTW, smail works fine on our SCO 2.2 and 2.3 OS's] Perhaps you're running a hacked-up shell? -- Dave Hammond ...!uunet!masa.com!{marob,dsix2}!daveh