From owner-freebsd-questions Fri Aug 18 6:17:35 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail-in-02.piro.net (mail-out-01.piro.net [194.64.31.11]) by hub.freebsd.org (Postfix) with ESMTP id 3CDEB37B422 for ; Fri, 18 Aug 2000 06:17:31 -0700 (PDT) Received: from nil.science-factory.com (ScienceFactory-atm1-153.piro.net [195.135.137.205]) by mail-in-02.piro.net (8.9.3/8.9.3/PN-991208) with ESMTP id PAA24648; Fri, 18 Aug 2000 15:17:29 +0200 Received: by nil.science-factory.com (Postfix, from userid 501) id 9FECA1E6B; Fri, 18 Aug 2000 15:15:33 +0200 (CEST) From: Marc van Woerkom To: bbec@capgemini.fr Cc: freebsd-questions@FreeBSD.ORG In-reply-to: <399D0056.953E6B67@capgemini.fr> (message from Bruno BEC on Fri, 18 Aug 2000 11:22:30 +0200) Subject: Re: Compile FreeBSD with an ANSI-C compiler References: <399D0056.953E6B67@capgemini.fr> Message-Id: <20000818131533.9FECA1E6B@nil.science-factory.com> Date: Fri, 18 Aug 2000 15:15:33 +0200 (CEST) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > We made the same experience with the Linux Kernel and had bad surprises > due to significant non ANSI code souce (this code is not rejected by gcc > which is not fully ANSI-C). > > Did one of you have any experience or information about the ANSI > compliance of the FreeBSD kernel ? Well in general there is old K&R style C, ANSI style C, and gcc C extensions. You will run into K&R and ANSI style C in case of FreeBSD Here is some K&R: static int mmrw(dev, uio, flags) dev_t dev; struct uio *uio; int flags; { register int o; register u_int c, v; u_int poolsize; register struct iovec *iov; int error = 0; caddr_t buf = NULL; while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; if (iov->iov_len == 0) { source: http://www.FreeBSD.org/cgi/cvsweb.cgi/src/sys/i386/i386/mem.c?rev=1.79.2.4&content-type=text/x-cvsweb-markup I am not sure if there are any gcc specific features used in the code. Possibly inline assembler would come to mind, that would be gcc specific syntax. But as far as I know the assembler code in FreeBSD is put into separate .S files. What I have seen are certain adjustment (extrac braces) to make sure it compiles with gcc. Guess you have to look at the code yourself. Regards, Marc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message