From owner-freebsd-hackers Wed Sep 4 04:27:27 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id EAA06933 for hackers-outgoing; Wed, 4 Sep 1996 04:27:27 -0700 (PDT) Received: from itchy.mindspring.com (itchy.mindspring.com [204.180.128.6]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id EAA06925 for ; Wed, 4 Sep 1996 04:27:23 -0700 (PDT) Received: from borg.mindspring.com (borg.mindspring.com [204.180.128.14]) by itchy.mindspring.com (8.7.5/8.7.3) with ESMTP id HAA10275; Wed, 4 Sep 1996 07:27:22 -0400 (EDT) Received: from bogus.interpath.net (user-168-121-39-4.dialup.mindspring.com [168.121.39.4]) by borg.mindspring.com (8.6.12/8.6.12) with SMTP id HAA18034; Wed, 4 Sep 1996 07:27:11 -0400 Message-Id: <1.5.4.32.19960904112714.006921c4@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: Wed, 04 Sep 1996 07:27:14 -0400 To: "Daniel O'Callaghan" From: "Kevin P. Neal" Subject: Re: void main Cc: Zach Heilig , Paul DuBois , hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk At 07:33 PM 9/4/96 +1000, Daniel O'Callaghan wrote: > > >On 4 Sep 1996, Zach Heilig wrote: > >> Paul DuBois writes: >> >> > Um, so what exactly is wrong with void main, other than that you don't >> > happen to like it? >> >> Strictly speaking, there are exactly two correct versions of main(): >> >> int main(void); >> int main(int argc, char *argv[]); >[lots of other stuff deleted] > >Well, if you do >int main(void) >{ > printf("Hello world\n"); >} > >and compile with gcc -Wall, gcc will complain about reaching the end of a >non-void function. Declaring main() to be void will remove that warning. >I use void main(void){...} a lot. Wait, that would cause (on a compiler that wasn't hacked to avoid this problem) your programs to return random numbers to the shell. You would return random numbers to the shell to avoid typing, like, 12 key strokes? -- XCOMM Kevin P. Neal, Sophomore, Comp. Sci. \ kpneal@pobox.com XCOMM "Corrected!" -- Old Amiga tips file \ kpneal@eos.ncsu.edu XCOMM Visit the House of Retrocomputing: / Perm. Email: XCOMM http://www.pobox.com/~kpn/ / kevinneal@bix.com