Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Dec 2014 10:01:01 -0600 (CST)
From:      Robert Bonomi <bonomi@mail.r-bonomi.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: which version of c for various components of freebsd?
Message-ID:  <201412241601.sBOG11Fc031998@host203.r-bonomi.com>
In-Reply-To: <20141223172848.GA57996@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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".  <wry grin>
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412241601.sBOG11Fc031998>