From owner-freebsd-hackers Wed Sep 4 07:51:01 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA15080 for hackers-outgoing; Wed, 4 Sep 1996 07:51:01 -0700 (PDT) Received: from rover.village.org (rover.village.org [204.144.255.49]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA15073 for ; Wed, 4 Sep 1996 07:50:58 -0700 (PDT) Received: from rover.village.org (localhost [127.0.0.1]) by rover.village.org (8.7.5/8.6.6) with ESMTP id IAA02679; Wed, 4 Sep 1996 08:50:28 -0600 (MDT) Message-Id: <199609041450.IAA02679@rover.village.org> To: "Daniel O'Callaghan" Subject: Re: void main Cc: Zach Heilig , Paul DuBois , "Kevin P. Neal" , hackers@FreeBSD.org In-reply-to: Your message of Wed, 04 Sep 1996 19:33:09 +1000 Date: Wed, 04 Sep 1996 08:50:27 -0600 From: Warner Losh Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk : 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. A simple return 0; at the end would fix the problem. Otherwise your program has a bug in that it will return a random value to the shell for its exit status (generally 11). Warner