From owner-cvs-all Mon May 28 5: 9:50 2001 Delivered-To: cvs-all@freebsd.org Received: from mailb.telia.com (mailb.telia.com [194.22.194.6]) by hub.freebsd.org (Postfix) with ESMTP id E3D4837B424 for ; Mon, 28 May 2001 05:09:45 -0700 (PDT) (envelope-from ertr1013@student.uu.se) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailb.telia.com (8.9.3/8.9.3) with ESMTP id OAA17867 for ; Mon, 28 May 2001 14:09:44 +0200 (CEST) Received: from ertr1013.student.uu.se (h185n2fls20o913.telia.com [212.181.163.185]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id OAA20661 for ; Mon, 28 May 2001 14:09:44 +0200 (CEST) Received: (qmail 35361 invoked by uid 1001); 28 May 2001 12:09:33 -0000 Date: Mon, 28 May 2001 14:09:32 +0200 From: Erik Trulsson To: cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/usr.bin/jot Makefile jot.c Message-ID: <20010528140932.A34999@student.uu.se> Mail-Followup-To: cvs-all@FreeBSD.ORG References: <52963.991050595@axl.fw.uunet.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <52963.991050595@axl.fw.uunet.co.za>; from sheldonh@starjuice.net on Mon, May 28, 2001 at 01:49:55PM +0200 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, May 28, 2001 at 01:49:55PM +0200, Sheldon Hearn wrote: > > > On Mon, 28 May 2001 21:43:58 +1000, Bruce Evans wrote: > > > > Since when do you have to add a prototype for main()?! > > > > Since -Wmissing-prototypes was added to CFLAGS (by WARNS=2 or BDECFLAGS) > > to detect the potential error of not declaring extern functions in > > the right place (which is never in *.c). > > Bleh. I think this is stupid. The compiler we use shouldn't force > us into unnecessary source work-arounds. Not providing a forward > declaration for main() is _always_ okay because it's _never_ called by > any other subroutine in the module. Are you sure about that ? Calling main recursively from some function in your program is perfectly legal in C. It is not allowed in C++ though and it might be considered bad programming style but that is another question. I do agree that the compiler should probably treat main() as a special case to make forward declarations of main() unnecessary. > > David, how would you feel about a local hack to gcc for this? > -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message