From owner-cvs-all Tue Dec 18 17:35: 0 2001 Delivered-To: cvs-all@freebsd.org Received: from smtp004pub.verizon.net (smtp004pub.verizon.net [206.46.170.183]) by hub.freebsd.org (Postfix) with ESMTP id D78B737B417; Tue, 18 Dec 2001 17:34:55 -0800 (PST) Received: from bellatlantic.net (pool-151-198-135-96.mad.east.verizon.net [151.198.135.96]) by smtp004pub.verizon.net with ESMTP ; id fBJ1YYJ26907 Tue, 18 Dec 2001 19:34:35 -0600 (CST) Message-ID: <3C1FEEA9.EEE89A7@bellatlantic.net> Date: Tue, 18 Dec 2001 20:34:33 -0500 From: Sergey Babkin Reply-To: babkin@freebsd.org X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 4.0-19990626-CURRENT i386) X-Accept-Language: en, ru MIME-Version: 1.0 To: Mark Murray Cc: John Baldwin , "David O'Brien" , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Luigi Rizzo , Garance A Drosihn Subject: Re: Are prototypes for main() illegal by any standard ? (was Re: References: <200112180848.fBI8mvO00685@grimreaper.grondar.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Mark Murray wrote: > > This I do not understand. :-) > > AFAIK, this is perfectly legal C: > > /* begin */ > void printf(char *, ...) > > void main(void) > { > printf("Hello world"); > } > /* end */ > > And it should compile warning-free and run without error. Agreed > that the style sucks, but it is _legal_ - and any compiler's prior No, it's completely wrong. The return type of main() is int. Otherwise you get garbage for the exit code. -SB To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message