From owner-freebsd-hackers Wed Sep 4 02:33:39 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id CAA03438 for hackers-outgoing; Wed, 4 Sep 1996 02:33:39 -0700 (PDT) Received: from panda.hilink.com.au (panda.hilink.com.au [203.2.144.5]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id CAA03431 for ; Wed, 4 Sep 1996 02:33:30 -0700 (PDT) Received: (from danny@localhost) by panda.hilink.com.au (8.7.5/8.7.3) id TAA02215; Wed, 4 Sep 1996 19:33:09 +1000 (EST) Date: Wed, 4 Sep 1996 19:33:09 +1000 (EST) From: "Daniel O'Callaghan" To: Zach Heilig cc: Paul DuBois , "Kevin P. Neal" , hackers@freebsd.org Subject: Re: void main In-Reply-To: <877mqa680r.fsf@freebsd.gaffaneys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. Danny