Re: linux headers and C++

Jes Sorensen (Jes.Sorensen@cern.ch)
05 Jul 1999 17:13:47 +0200


>>>>> "Jamie" == Jamie Lokier <lkd@tantalophile.demon.co.uk> writes:

Jamie> Jes Sorensen wrote:
>> The kernel is written in C, there is no reason to pollute drivers
>> and other parts of the kernel with restrictions to make it C++
>> compatible.

Jamie> I don't mean drivers or any other part of the kernel.

Jamie> I mean third-party code written to run in kernel space, in C++.
Jamie> It's possible to make much use of C++ in this area. You might
Jamie> not like to use it, but that's not a good reason to prevent it.

I am fully aware of that.

Jamie> If significant support was required I would suggest forgetting
Jamie> the idea. But I believe the changes are minor, easily
Jamie> understood cleanups, so I see no reason to rule it out.

The point here is that you should not try to use C++ features inside
the kernel, ie. things like exceptions are not meant to be used within
the kernel as you do not know what it will do to your stack etc. Again
the kernel is written in C, let it stay like that.

Forcing people to write kernel code in C like this actually prevents a
lot of nasty disasters that will be hard to debug.

Jes

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/