Re: [dev] c++-style comments [was fsbm]

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Fri, 7 Nov 2014 10:30:20 +0100

On Thu, Nov 6, 2014 at 6:09 PM, Dimitris Papastamos <sin_AT_2f30.org> wrote:
> On Thu, Nov 06, 2014 at 05:56:55PM +0100, Sylvain BERTRAND wrote:
>> On Thu, Nov 06, 2014 at 03:40:56PM +0000, Dimitris Papastamos wrote:
>> > On Thu, Nov 06, 2014 at 04:38:20PM +0100, Sylvain BERTRAND wrote:
>> > > On a personnal level, I port some of my C99 projects back to C89, since it
>> > > seems a C89 compiler is easier to write than a C99 compiler, and some part of
>> > > my code could go in C89 only project (i.e. the linux kernel).
>> >
>> > the linux kernel is built with gnu99 iirc.
>>
>> Documentation/HOWTO:
>> "The kernel is written using GNU C and the GNU toolchain. While it
>> adheres to the ISO C89 standard, it uses a number of extensions that are
>> not featured in the standard. The kernel is a freestanding C
>> environment, with no reliance on the standard C library, so some
>> portions of the C standard are not supported. Arbitrary long long
>> divisions and floating point are not allowed. It can sometimes be
>> difficult to understand the assumptions the kernel has on the toolchain
>> and the extensions that it uses, and unfortunately there is no
>> definitive reference for them. Please check the gcc info pages (`info
>> gcc`) for some information on them."
>
> It uses a *lot* of extensions. If I remember correctly, a significant number
> of gcc extensions were initially driven by the needs of linux kernel programmers.
>
> A C89 only compiler would have no hope to build the kernel in any way
> so I do not see how C89 is relevant here anymore.

There is the http://llvm.linuxfoundation.org/index.php/Main_Page
project that works towards getting the Kernel to compile with clang.
That effort should hopefully increase the standards conformance of
Kernel code at least somewhat.


Cheers,

Silvan
Received on Fri Nov 07 2014 - 10:30:20 CET

This archive was generated by hypermail 2.3.0 : Fri Nov 07 2014 - 10:36:09 CET