Slashdot Mirror


A New C Standard Is On the Way

Esther Schindler writes "Last year, Danny Kalev — a former member of the C++ standards committed — explained the new features in C++. Now, in C11: A New C Standard Aiming at Safer Programming, he shares an overview of the changes in C — 13 years after the ratification of the C99 standard. Kalev describes the goodies in C11, including multi-threading support, safer standard libraries, and better compliance with other industry standards."

2 of 305 comments (clear)

  1. Drops the most important feature of C99 by Anonymous Coward · · Score: 5, Interesting

    C11 will make var arrays, one of the most widely used C99 features, optional due to pressure from Microsoft, who refuses to implement C99.

  2. Re:Slow Adoption of Current Standards by serviscope_minor · · Score: 5, Interesting

    Yes, I totally think we should rewrite the linux kernel in C++

    I don't know if you're trolling, but I agree, it is the logical thing to do.

    Linux has many, many C++ features implemented in an ad-hoc and poorly specified way in C.

    It is very heavy on OO style with derived classes and virtual functions.

    TRhe C style objects are complex and require init and cleanup functions to be called.

    They have imlemented type-generic macros in order to reduce code duplication effectively.

    Basically, C++ takes those three things and integrates them into the language in a standard way so that everyone uses them in the same way, you get sane error messages and compiler support. C++ has one additionmal advantage that it has one global vtable per class, so each instance has a single pointer to the vtable. Linux's C-style OO has each instance having a pointer to every virtual method otherwise the syntax would be too unpleasant. This makes it less memory efficient in C and increaces the cache footprint.

    The only thing worse about C++ would be that the compile times would be increased.

    But that's a tiny price to pay for fewer bugs and faster code.

    --
    SJW n. One who posts facts.