Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: main return value Message-ID: <16136@smoke.brl.mil> Date: 13 May 91 07:24:56 GMT References: Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 In article cschmidt@lynx.northeastern.edu writes: >What value should the standard function MAIN return? If main returns at all, it returns an int. It should be so declared. >3. Declare the MAIN return type as INT and terminate the function > with the line "return EXIT_SUCCESS". The problem with this is > that EXIT_SUCCESS is zero, even in the VAX version, and when a VMS > program terminates and returns zero to VMS, VMS displays the > system message for status code zero. (The universal status code > for success in VMS is one, not zero.) If your VMS C compiler really has this bug, get the vendor to fix it. The DEC representative to X3J11 agreed than VMS C would map a 0 exit status value to SYS$SUCCESS (an odd number, probably 1) before handing in back to the invoking environment. The EXIT_* macros were introduced primarily as a political compromise to accommodate VMS C.