which version of c for various components of freebsd?

Robert Bonomi bonomi at mail.r-bonomi.com
Wed Dec 24 16:09:29 UTC 2014


> 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.


More information about the freebsd-questions mailing list