Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 1997 16:52:09 -0700
From:      Warner Losh <imp@village.org>
To:        "Gregory D. Moncreaff" <moncrg@dominus.ma.ultranet.com>
Cc:        "hackers@freebsd.org" <hackers@freebsd.org>
Subject:   Re: C++ Code in Kernel 
Message-ID:  <E0wAlRJ-0001zK-00@rover.village.org>
In-Reply-To: Your message of "Fri, 28 Mar 1997 18:10:51 EST." <01BC3BA3.6FFD23A0@dominus.ultranet.com> 
References:  <01BC3BA3.6FFD23A0@dominus.ultranet.com>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <01BC3BA3.6FFD23A0@dominus.ultranet.com> "Gregory D. Moncreaff" writes:
: maybe its just that I'm taking a c++ class now, but I'm
: cusious as to the pro's and con's on writing kernel source
: in c++.  I haven't seen nor heard on this happening on FreeBSD
: [but then my travels haven't been that wide]
: 
: I assume that new and delete would have to be overloaded, and
: that there would have to be some magic with respect to normal c
: calling c++ code [name mangling]
: 
: Has this come up before?

Uggg.

Pro: You are using c++.
Con: You are using c++.

The biggest problem is getting static ctors called when your module is
loaded, and the dtors called when it is unloaded.  You'll also need to
bring into the kernel the various support routines like new, delete,
etc.  You'll also have to be very careful with name mangling.
Includes may be a problem, since I don't think they are all c++ clean.

This definitely isn't supported :-)

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0wAlRJ-0001zK-00>