Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2001 15:36:30 -0400
From:      Graywane <graywane@home.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: _Can I use C++ to write device drivers?
Message-ID:  <20010411153630.A5200@home.com>
In-Reply-To: <F974XFKpRcTCi90gP8y000050c1@hotmail.com>; from burnscharlesn@hotmail.com on Wed, Apr 11, 2001 at 11:30:51AM -0700
References:  <F974XFKpRcTCi90gP8y000050c1@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 11, 2001 at 11:30:51AM -0700, Charles Burns wrote:
> (Pre-note. I am not a driver expert by any means)

Neither am I :)

> You can write a driver for FreeBSD in any language that can compile, i.e., 
> any non-interpreted language. C++ may not be the best choice for a driver 
> because it has slightly higher overhead in some cases than C, and many of 
> its advantages probably wouldn't be very useful in writing drivers.

Most of the C++ bloat comes from templates. C++ code without any templates
is comparable in size and execution speed to C code. So as long as you don't
use templates (which basically means avoid the entire standard C++ library)
then C++ would be a fine language for kernel module development.

Of course, ISO 9899-1999 fixed the two most annoying C problems -- declaring
variables only at the start of a block and no // comments.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010411153630.A5200>