Re: Compiling C++ kernel module + Makefile

From: Valdis . Kletnieks
Date: Tue Jan 20 2004 - 00:31:36 EST


On Mon, 19 Jan 2004 18:40:18 +0100, Bart Samwel said:

> Now, let me try to add a bit of nuance to your suggested solution. Try
> porting 100s of C++ files (yes, it's that large) making heavy use of
> inheritance etc. to C. Then try to make a bit of C code usable as extern
> "C" in C++. Extern "C" was actually meant to be able to grok most C
> code, while C++ wasn't meant to be easily portable to C. So, for any
> moderately large module that uses any C++ features at all, it's probably
> easier to make small syntactic changes to the kernel than to port the
> module to C (which would amount to a full rewrite).

That's one honking big module. Everybody please join me in a sigh of relief
that the culprits didn't think Scheme was a suitable language.

Anybody who thinks that C++ should be anywhere on the kernel side of the kernel/
user interface should understand why the kernel design doesn't even allow the
use of *floating point* without much jumping through hoops. They then should
ponder the political climate that created EXPORT_SYMBOL_GPL, which is
(basically) a "this is OUR kernel and if you don't want to play by our rules,
we intend to make things difficult for you".

The module authors should then ask themselves what they're bringing to the
table that's worth the kernel developers changing the way they do things.
Unless there's a demonstrable reason or advantage to changing, the idea to
support C++ is probably as dead-on-arrival as the heavily lambasted proposal to
have a stable API for modules a while back.

Attachment: pgp00000.pgp
Description: PGP signature