Path: utzoo!utgpu!water!watmath!clyde!burl!codas!mtune!whuts!homxb!mr From: mr@homxb.UUCP (mark) Newsgroups: comp.lang.c Subject: Re: exit(main(argc,argv,env)); Message-ID: <1253@homxb.UUCP> Date: 17 Dec 87 17:17:04 GMT References: <10875@brl-adm.ARPA> Organization: AT&T Lines: 22 In article <10875@brl-adm.ARPA>, ADLER1%BRANDEIS.BITNET@CUNYVM.CUNY.EDU writes: > I was looking through the file crt0.c in the GNU emacs source code and > found the command > > exit(main(argc,argv,env)); > > which I find puzzling. I thought that one was supposed to give exit a > number for an argument. What does the above command do and why would > anyone want to do it that way ? > > ADLER1@BRANDEIS.BITNET main() returns an int which is then the argument to exit() and is then returned to the shell or whatever exec'ed the program. This brings up an interesting problem : What if you declare main to return something other than an int ? Is that allowed ? mark homxb!mr