[lkml]   [2000]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Linux kernel modules development in C++
Marty Fouts <> said:


> This list provides, I believe, an example of a class of programmers who have
> little interest in the standard definition of the language, since, I'm told,
> the Linux kernel isn't written in a standard programming language, but,
> rather, in a dialect which is a subset of Gnu C. Thus, to be a linux kernel
> hacker, it seems, one would be more interested in knowing what that dialect
> is than in knowing what the standard is.

There are a bunch of advantages to using GCC's C in kernel: asm() is one
rather large one. Some other extensions that are used extensively are
inline functions, and the ability to manipulate sections in C. Other, less
used ones, are varargs macros and local variables in expressions. gcc
provides these extensions because it has been mostly developed for use on
embedded devices, trying to write something as hardware-oriented as a OS
kernel in standard C is out of the question; gcc is good enough and
available for anything you'd want to build Linux on, so portability to
other compilers isn't any priority.

OTOH, the standard is important anyway, you'd better know where the compier
is going (since it does follow the language standard), and to try to write
standard code where that makes sense.
Dr. Horst H. von Brand
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:39    [W:0.053 / U:1.340 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site