Re: C++ in kernel (was Re: exception in a device driver)

Chip Salzenberg (chip@perlsupport.com)
Mon, 11 Jan 1999 00:13:03 -0500


According to Alan Cox:
> So to write optimal C++ I have to know at least as much as the internal
> structure of the code than for C.

Sure. The same machine is under there, whichever language you use;
you always have to know what's going on under the hood if optimal
performance is the goal. None of this is an argument against C++ per
se, particularly if you just choose to use its 'better C' subset.

> C++ is less efficient because the compiler cannot perform some
> optimisations it can in C without help from the code writer.

C++ is *not* less efficient. It can't be, seeing as how it's
almost[*] a proper superset of C, so there's nothing about the C
subset that prevents just-as-good code generation.

[*] modulo added keywords and obscure points like typeof('c').

-- 
Chip Salzenberg      - a.k.a. -      <chip@perlsupport.com>
      "When do you work?"   "Whenever I'm not busy."

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