Path: utzoo!attcan!uunet!mcvax!unido!tub!uwbln!ckl From: ckl@uwbln.UUCP (Christoph Kuenkel) Newsgroups: comp.lang.c Subject: Re: is there anything wrong with return(n) from main? Message-ID: <844@uwbull.uwbln.UUCP> Date: 15 Jul 88 09:03:53 GMT References: <741@vsi.UUCP> Distribution: comp Organization: UniWare GmbH, Berlin Lines: 18 In article <741@vsi.UUCP>, friedl@vsi.UUCP (Stephen J. Friedl) writes: > For some unknown reason, I have always felt uncomfortable > doing a return(n) from main: I used exit(n) instead. Can anybody > think of any possible reason why a return is not a good idea? There are simply some implementations of _startup() that don't take care of the returnvalue of main() (we have that problem here). You should code: main() { ... exit(retcode); /*NOTREACHED*/ } This should work in any case. christoph -- Christoph Kuenkel/UniWare ck@tub.BITNET Kantstr. 152 uunet!unido!tub!ck 1000 Berlin 12 {unido,tmpmbx,uwnue,nixbln,tub}!uwbln!ckl West Germany