Date: Wed, 04 Sep 1996 07:27:14 -0400 From: "Kevin P. Neal" <kpneal@pobox.com> To: "Daniel O'Callaghan" <danny@panda.hilink.com.au> Cc: Zach Heilig <zach@blizzard.gaffaneys.com>, Paul DuBois <dubois@primate.wisc.edu>, hackers@freebsd.org Subject: Re: void main Message-ID: <1.5.4.32.19960904112714.006921c4@mindspring.com>
next in thread | raw e-mail | index | archive | help
At 07:33 PM 9/4/96 +1000, Daniel O'Callaghan wrote: > > >On 4 Sep 1996, Zach Heilig wrote: > >> Paul DuBois <dubois@primate.wisc.edu> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1.5.4.32.19960904112714.006921c4>