From owner-freebsd-questions@FreeBSD.ORG Wed Dec 24 16:09:29 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07A0CEC8 for ; Wed, 24 Dec 2014 16:09:29 +0000 (UTC) Received: from host203.r-bonomi.com (host203.r-bonomi.com [204.87.227.203]) by mx1.freebsd.org (Postfix) with ESMTP id A649425A2 for ; Wed, 24 Dec 2014 16:09:28 +0000 (UTC) Received: (from bonomi@localhost) by host203.r-bonomi.com (8.14.9/8.14.7) id sBOG11Fc031998 for freebsd-questions@freebsd.org; Wed, 24 Dec 2014 10:01:01 -0600 (CST) (envelope-from bonomi) Date: Wed, 24 Dec 2014 10:01:01 -0600 (CST) From: Robert Bonomi Message-Id: <201412241601.sBOG11Fc031998@host203.r-bonomi.com> To: freebsd-questions@freebsd.org Subject: Re: which version of c for various components of freebsd? In-Reply-To: <20141223172848.GA57996@neutralgood.org> X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2014 16:09:29 -0000 > On Mon, Dec 22, 2014 at 01:44:23PM +0530, Mayuresh Kathe wrote: > > hello, > > may i know which version of c is used for various components of freebsd? > is c89 being used for the kernel? what about rest of the system? As of 8.4 at least, compilation of the kernel (and kernel modules) uses the 'c99' standard -- with the exception of a handful of c99 features not supported by GCC. I have -not- verified for other components of the 'base' installation, but I would presume the same is true for them. For ports, "you pays your money and takes your chances applies". It depends on what the author wrote to. if they use a language feature that exists only in a particular standard, that standard will be indicated in the makefile, and thus is 'transparent' to the user of that port. For reference: C11 (the latest standard, adopted last year) is a superset of C99 *EXCEPT* that 'gets(3)' -- previously 'depreciated' -- has been removed. replaced with a bounds-limited gets_s(3) C99 is a strict superset of C89. C89 is a major divergence from the original K&R C. There are lots of things K&R accepted/allowed that ANSI C (C89 or newer) will not accept. There were also massive changes to function proto- typing and function declarations.