Date: Wed, 4 Sep 1996 19:33:09 +1000 (EST) From: "Daniel O'Callaghan" <danny@panda.hilink.com.au> To: Zach Heilig <zach@blizzard.gaffaneys.com> Cc: Paul DuBois <dubois@primate.wisc.edu>, "Kevin P. Neal" <kpneal@pobox.com>, hackers@freebsd.org Subject: Re: void main Message-ID: <Pine.BSF.3.91.960904193041.2133C-100000@panda.hilink.com.au> In-Reply-To: <877mqa680r.fsf@freebsd.gaffaneys.com>
index | next in thread | previous in thread | raw e-mail
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.
Danny
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960904193041.2133C-100000>
