Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.sys.apple2 Subject: Re: Orca/C, bug? Message-ID: <14200@smoke.BRL.MIL> Date: 19 Oct 90 19:31:36 GMT References: <11906@bsu-cs.bsu.edu> <4b7SZuu00Vox0UOlYs@andrew.cmu.edu> <1990Oct19.133843.26089@nntp-server.caltech.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article <1990Oct19.133843.26089@nntp-server.caltech.edu> toddpw@tybalt.caltech.edu (Todd P. Whitesel) writes: >jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) writes: >>1.) Never declare main as void. Main returns an int. >Um, I have been writing void main (...) without problems ever since I >got ORCA (over 1 month of extensive use). If I declare main as void then >everything works; if I try to return something from main I get an error >because main is declared to return void. Jeffrey is correct. Since main() is expected to return an integer, it had better do so. Otherwise the C runtime startup code could get tangled up when it tries to use the (nonexistent) value. It may be that a particular version of a particular compiler does not create code that runs entirely amok when your program attempts this sort of abuse, but you shouldn't rely on that. Do it right and avoid potential problems.