On Mon, Jan 23, 2012 at 08:53:36AM +1000, Da Rock wrote:
> On 01/23/12 07:26, Chad Perrin wrote:
> > On Sun, Jan 22, 2012 at 09:33:02PM +0100, Roland Smith wrote:
> >> PCC is only a C compiler, and there is some C++ code (e.g. groff) in the 
> >> base
> >> system. The FreeBSD port is marked as i386 and amd64 only, even though 
> >> other
> >> architectures seem to be there in the PCC source.
> > I had somehow forgotten there was anything in the base system written in
> > C++.  That would probably account for the choice of Clang over PCC.
> What part is that? I thought it had to be all c...

To the best of my knowledge the restriction to C only applies to the kernel
and libraries, not to the utilities in the base system. And it is for a
technical reason. C++ "mangles" function names to e.g. include argument types
and class names. See 
[http://en.wikipedia.org/wiki/Name_mangling#Name_mangling_in_C.2B.2B].
This practically means that you can use a C library from a C++ program, but not
the other way around.

Then again, the kernel has more restrictions. Like no floating point allowed
and no libc available. And presumably many more w.r.t. locking of data
structures and practical limits on interrupt handlers.

Roland
-- 
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

Attachment: pgpnUWoFLdT0T.pgp
Description: PGP signature

Reply via email to