Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2006 13:19:18 +0200
From:      des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=)
To:        mag@intron.ac
Cc:        freebsd-hackers@freebsd.org, delphij@delphij.net, Julian Elischer <julian@elischer.org>
Subject:   Re: kern/99979: Get Ready for Kernel Module in C++
Message-ID:  <868xn0z8w9.fsf@xps.des.no>
In-Reply-To: <courier.44B37714.00004B4D@intron.ac> (mag@intron.ac's message of "Tue, 11 Jul 2006 18:01:56 %2B0800")
References:  <200607092136.k69LaNDX055391@www.freebsd.org> <84dead720607092015q7f1701abse143f3855c2aa95a@mail.gmail.com> <1152540567.99616@origin.intron.ac> <44B2AE69.4080703@elischer.org> <44B2D2DF.2000401@sh.cvut.cz> <86sll8zl9x.fsf@xps.des.no> <courier.44B35DBC.00003F75@intron.ac> <86fyh8zgw8.fsf@xps.des.no> <courier.44B37714.00004B4D@intron.ac>

next in thread | previous in thread | raw e-mail | index | archive | help
mag@intron.ac writes:
> But "-ffreestanding" doesn't work with C++.

While the C++ standard does define hosted and freestanding
implementations, its definition is different from (and less useful
than) that in the C standard.  For instance, the C++ standard requires
the existence of abort(), atexit() and exit() even in a freestanding
implementation.

Basically, one cannot indiscriminately use the same compiler flags for
C and C++, because they are very different languages - far more
different than they seem on the surface.  Modern C++ is very poorly
suited for low-level code.

> According to above explanation, "-fno-builtin" is a subset of
> "-ffreestanding" and it's enough for kernel.

No, it isn't.  I think you would do wisely to acquire a little more
knowledge of and experience with C, C++ and kernel programming before
you pursue this topic any further.

Most importantly, we already have an working object model in the
FreeBSD kernel, with classes, inheritance, and all that jazz,
implemented partly in C and partly in a custom IDL which is translated
into C by src/sys/tools/makeobjops.awk.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no



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