From owner-cvs-all Sun Dec 16 16: 5: 1 2001 Delivered-To: cvs-all@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 56B9437B417 for ; Sun, 16 Dec 2001 16:04:53 -0800 (PST) Received: (qmail 29835 invoked from network); 17 Dec 2001 00:04:52 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 17 Dec 2001 00:04:52 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20011216075240.A29455@dragon.nuxi.com> Date: Sun, 16 Dec 2001 16:04:43 -0800 (PST) From: John Baldwin To: "David O'Brien" Subject: Re: Are prototypes for main() illegal by any standard ? (was Re: Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Mark Murray , Luigi Rizzo , Garance A Drosihn 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 16-Dec-01 David O'Brien wrote: > On Sat, Dec 15, 2001 at 05:53:49PM -0500, Garance A Drosihn wrote: >> If adding the prototype for main() does *break* something, then it >> would be helpful to find out what it is that breaks. > > main() is special. The C compiler knows it returns an int and for us, > can take up to three arguments. Because the prototype for main() is set > in stone, that is why the user should not supply one. Lest they will > prototype it as "void main (float, char *[])". > > We would not add a prototype for printf() in a program, we would include > stdio.h instead. This is the same with main() except rather than it > being prototyped in a header, it is prototyped w/in the compiler. > > This is comming up due to a bug in a single compiler. We have fixed that > compiler. AFAIK the other two compilers we use at all today -- TenDRA > and Compaq's compiler does not have this bug. So why change all this > code when we fixed things at the source of the problem? Agreed. Requesting prototypes for main is the compiler bug, not hiding the warning for main. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message