Re: Object Oriented Linux

From: Khimenko Victor (khim@sch57.msk.ru)
Date: Wed Jul 12 2000 - 17:47:00 EST


In <20000711103103.C3446@codepoet.org> Erik Andersen (andersen@codepoet.org) wrote:
> On Tue Jul 11, 2000 at 11:55:50AM +0300, Sherif Abou Seda wrote:
>> i'm trying to change the module of Inter Process Comunication in the Linux
>> Kernel from Stuctured Programming into Object Oriented Programming but when
>> i tried to compile the kernel with my code in it, i had some problems in
>> integrate the kernel which contain both C and C++ code in it
>> can anyone help me about this

> you must use

> #ifdef __cplusplus
> extern "C" {
> #endif
> // C++ headers
> }

> to define all C++ function prototypes to avoid c++
> name mangling,

It will be not enough. WAY not enough. Kernel does not have malloc and
friends so new/free can not be used (allocations in kernel should be used
ONLY when really necessary). Kernel has less then 7K stack so you can not
put a lot of data there as well. Kernel lacks suppot for rtti and exceptions.
And so on and so on. In short: even if kernel IS object-oriented it does not
support C++ usage at all. Even more: this question was raised few times @ lkml
and leading kernel developer's reaction was always the same: "Linux is free
software so you can do anything with it, of course. In your home under pillow
that is. But if we are talking about mainstreem though then do not think ANY
patches for C++ support will be accepted (may be patches to make header more
C++ firendly will be accepted but even this is VERY questionable). We have no
desire to support ANY alien languages in kernel - be it Ada, Pascal,
Objective C or C++."

-
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/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:15 EST