From owner-cvs-all Tue Dec 18 1:14:17 2001 Delivered-To: cvs-all@freebsd.org Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.139.170]) by hub.freebsd.org (Postfix) with ESMTP id C7F0C37B41C; Tue, 18 Dec 2001 01:14:06 -0800 (PST) Received: (from uucp@localhost) by storm.FreeBSD.org.uk (8.11.6/8.11.6) with UUCP id fBI9E5Q41504; Tue, 18 Dec 2001 09:14:05 GMT (envelope-from mark@grondar.za) Received: from grondar.za (mark@localhost [127.0.0.1]) by grimreaper.grondar.org (8.11.6/8.11.6) with ESMTP id fBI8mvO00685; Tue, 18 Dec 2001 10:48:57 +0200 (SAST) (envelope-from mark@grondar.za) Message-Id: <200112180848.fBI8mvO00685@grimreaper.grondar.org> To: John Baldwin Cc: "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: In-Reply-To: ; from John Baldwin "Sun, 16 Dec 2001 16:04:43 PST." Date: Tue, 18 Dec 2001 10:48:56 +0200 From: Mark Murray 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 > > 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. 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 assumed knowledge about main is plain wrong - it is a linker thing to use ``main'' as an entry point, and nobody else's damn business what it is after that! (argc and argv are likewise conventions that are less useful in an embedded environment with no shell (ya, ya I know about execv :)). Now if anyone can show official standards showing me that I'm wrong here, I'll shut up and back off. :-) M -- o Mark Murray \_ FreeBSD Services Limited O.\_ Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message