Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2012 21:14:35 +0100
From:      Roland Smith <rsmith@xs4all.nl>
To:        freebsd-questions@freebsd.org
Subject:   Re: Clang - what is the story?
Message-ID:  <20120123201435.GB32692@slackbox.erewhon.net>
In-Reply-To: <4F1C9370.8080609@herveybayaustralia.com.au>
References:  <20120121133506.7bcfaec9@gumby.homeunix.com> <20120121154313.53d3fec6@gumby.homeunix.com> <20120122070205.GA13081@hemlock.hydra> <4F1BB640.2050707@herveybayaustralia.com.au> <20120122074558.GA22918@hemlock.hydra> <4F1BD17C.3030209@herveybayaustralia.com.au> <20120122123748.GA26579@hemlock.hydra> <20120122203302.GA90962@slackbox.erewhon.net> <20120122212653.GA2489@hemlock.hydra> <4F1C9370.8080609@herveybayaustralia.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

--+g7M9IMkV8truYOl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 t=
he 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 typ=
es
and class names. See=20
[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
--=20
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)

--+g7M9IMkV8truYOl
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk8dv6sACgkQEnfvsMMhpyV/sQCgjsTuqhU1LOIzOzml22al7m5F
ynEAnj8E8RqbEvqy25h8BV2VRW+lUoTR
=1lTu
-----END PGP SIGNATURE-----

--+g7M9IMkV8truYOl--



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