From owner-freebsd-hackers Sat May 31 15:02:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA17497 for hackers-outgoing; Sat, 31 May 1997 15:02:02 -0700 (PDT) Received: from brickbat9.mindspring.com (brickbat9.mindspring.com [207.69.200.12]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA17489 for ; Sat, 31 May 1997 15:01:58 -0700 (PDT) Received: from bogus.mindspring.com (user-37kb9f2.dialup.mindspring.com [207.69.165.226]) by brickbat9.mindspring.com (8.8.5/8.8.5) with SMTP id RAA00869; Sat, 31 May 1997 17:57:18 -0400 (EDT) Message-Id: <1.5.4.32.19970531220152.008b46f0@mindspring.com> X-Sender: kpneal@mindspring.com X-Mailer: Windows Eudora Light Version 1.5.4 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 31 May 1997 18:01:52 -0400 To: Steve Howe From: "Kevin P. Neal" Subject: Re: Borland 16bit bcc vs cc/gcc (float) Cc: freebsd-hackers Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk At 12:03 PM 5/31/97 -0800, Steve Howe wrote: > >On Sat, 31 May 1997, J Wunsch wrote: > >> > void main (unsigned char argc, unsigned char **argv) { > >> Don't get caught in comp.lang.c with this. :) It's an invalid >> definition of main, thus the behaviour is implementation-dependant. >> gcc could have exited immediately without violating the standard. > >ahhh! :) everyone says this - but exit() never returns, so main >never returns anything, so IMHO, main should always be type void. Who says you always have to use exit()? In fact, I've observed C++ code that never calls the destructors if you exit() of out a program. All of my programs return(0); out of main(). After all, main() is not special in any way, other than being the conventional entry point of user written code. If you wanted to write your own entry code (crt0.o or whatever) you wouldn't even need main(). I've seen AmigaDOS programs that had no main(). This is one of my favorite rants. I gave a friend of mine the 15 minute explanation of why void main() is wrong, and he told his instructor. She placed him out of her class and into the next one up. -- XCOMM Kevin P. Neal, Junior, Comp. Sci. - House of Retrocomputing XCOMM mailto:kpneal@pobox.com - http://www.pobox.com/~kpn/ XCOMM kpneal@eos.ncsu.edu Spoken by Keir Finlow-Bates: XCOMM "Good grief, I've just noticed I've typed in a rant. Sorry chaps!"