public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Esben Nielsen <simlo@phys.au.dk>
Cc: "Budde, Marco" <budde@telos.de>, linux-kernel@vger.kernel.org
Subject: Re: kbuild & C++
Date: Wed, 7 Sep 2005 00:32:26 +0200	[thread overview]
Message-ID: <9a8748490509061532235cefa5@mail.gmail.com> (raw)
In-Reply-To: <Pine.OSF.4.05.10509070012390.28020-100000@da410.phys.au.dk>

On 9/7/05, Esben Nielsen <simlo@phys.au.dk> wrote:
> On Tue, 6 Sep 2005, Jesper Juhl wrote:
> 
> > On 9/6/05, Budde, Marco <budde@telos.de> wrote:
> > > Hi,
> > >
> > > for one of our customers I have to port a Windows driver to
> > > Linux. Large parts of the driver's backend code consists of
> > > C++.
> > >
> > > How can I compile this code with kbuild? The C++ support
> > > (I have tested with 2.6.11) of kbuild seems to be incomplete /
> > > not working.
> > >
> >
> > That would be because the kernel is written in *C* (and some asm), *not* C++.
> > There /is/ no C++ support.
> 
> Which is too bad. You can do stuff much more elegant, effectively and
> safer in C++ than in C. Yes, you can do inheritance in C, but it leaves
> it up to the user to make sure the type-casts are done OK every time. You
> can with macros do some dynamic typing, but not nearly as effectively as
> with templates, and those macros always comes very, very ugly. (Some say
> templates are ugly, but they first become ugly when they are used
> way beyond what you can do with macros.)
> 
> I think it can only be a plus to Linux to add C++ support for at least
> out-of-mainline drivers. Adding drivers written in C++ into the mainline
> is another thing.
> 

I was not trying to start a discussion about the merrits of C vs C++.
I was simply responding to marco's comment that "C++ support ... of
kbuild seems to be incomplete / not working".

As for C++ vs C.  I don't have anything against C++. I use it a lot
for userspace programs. I'm not sure I agree that it would be
appropriate for the kernel though, but that's a whole other
discussion.


-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

  parent reply	other threads:[~2005-09-06 22:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-06 11:23 kbuild & C++ Budde, Marco
2005-09-06 11:30 ` Bernd Petrovitsch
2005-09-06 21:08   ` Chris Frey
2005-09-07  6:39     ` Bernd Petrovitsch
2005-09-06 11:38 ` linux-os (Dick Johnson)
2005-09-06 21:20 ` Jesper Juhl
2005-09-06 22:20   ` Esben Nielsen
2005-09-06 22:22     ` Randy.Dunlap
2005-09-06 22:32     ` Jesper Juhl [this message]
2005-09-07  2:33     ` Valdis.Kletnieks
2005-09-07  9:21       ` Esben Nielsen
2005-09-07 10:11         ` Valdis.Kletnieks
2005-09-07 10:58           ` Esben Nielsen
2005-09-07 11:44         ` Bernd Petrovitsch
2005-09-06 21:41 ` Sam Ravnborg
2005-09-10 12:29 ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2005-09-07  9:13 Budde, Marco
2005-09-07  9:57 ` Valdis.Kletnieks
2005-09-07 10:45   ` Esben Nielsen
2005-09-07 10:00 ` Bernd Petrovitsch
2005-09-07 10:17 Budde, Marco
2005-09-07 18:52 ` Lee Revell
     [not found] <4JJOt-77X-9@gated-at.bofh.it>
2005-09-07 12:02 ` Bodo Eggert
2005-09-07 12:04 Budde, Marco
2005-09-07 12:58 ` Bernd Petrovitsch
2005-09-07 13:15 ` Nick Piggin
2005-09-15 12:35 Budde, Marco
2005-09-18 18:41 ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a8748490509061532235cefa5@mail.gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=budde@telos.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simlo@phys.au.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox