From owner-freebsd-hackers Fri Mar 28 15:52:18 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA13871 for hackers-outgoing; Fri, 28 Mar 1997 15:52:18 -0800 (PST) Received: from rover.village.org (rover.village.org [204.144.255.49]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id PAA13859 for ; Fri, 28 Mar 1997 15:52:15 -0800 (PST) Received: from rover.village.org [127.0.0.1] by rover.village.org with esmtp (Exim 1.60 #1) id 0wAlRJ-0001zK-00; Fri, 28 Mar 1997 16:52:09 -0700 To: "Gregory D. Moncreaff" Subject: Re: C++ Code in Kernel Cc: "hackers@freebsd.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> Date: Fri, 28 Mar 1997 16:52:09 -0700 From: Warner Losh Message-Id: Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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