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."

16 of 305 comments (clear)

  1. On the way? by TheRaven64 · · Score: 5, Informative

    It's not on the way, it was released last year. Both gcc and clang are already a good way along implementing it, and we've added a big chunk of the library support to FreeBSD libc already.

    --
    I am TheRaven on Soylent News
    1. Re:On the way? by Tough+Love · · Score: 5, Funny

      The "11" actually refers to how far you can turn up the volume.[1]

      [1] Quoted from Tough Love's Album of Unreliable Facts (c)

      --
      When all you have is a hammer, every problem starts to look like a thumb.
    2. Re:On the way? by shutdown+-p+now · · Score: 5, Insightful

      This being C, 11 would mean that you can turn the volume from 0 all the way up to 10.

    3. Re:On the way? by Bacon+Bits · · Score: 5, Funny

      No, you can turn the volume up as high as you want, but it's only defined for 0 to 10.

      --
      The road to tyranny has always been paved with claims of necessity.
  2. C11???? by highphilosopher · · Score: 5, Funny

    That's great! I'm still using C4, and every time I compile my code blows up!

    1. Re:C11???? by Anonymous Coward · · Score: 5, Funny

      Plus, as using C-14, I am able to determine the compiling date of any given code.

    2. Re:C11???? by Sduic · · Score: 5, Funny

      The worst part was the C4 standard was prepared with SemTeX.

      --
      *this space intentionally left blank
      "One of the four pointers saying 'come and see', and I saw, and beheld a white
    3. Re:C11???? by dintech · · Score: 5, Funny

      Since I'm using C64, I find I have to be careful with my memory usage.

  3. 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.

  4. Integer overflow! by Montreal · · Score: 5, Funny

    C99 -> C11, come on guys ...

  5. Jeezus christ by JustNiz · · Score: 5, Funny

    If I wanted plastic scissors I'd use Java. Give me my scalpel back.

  6. Re:Missing features by AuMatar · · Score: 5, Informative

    C runs on way too many devices without floating point support to add those as standard libraries. It wouldn't be useful on many platforms.

    And C isn't about adding every feature in the world. The language itself is pretty much done. They're just changing libraries. They'll never add a major feature like closures, nor should they. If you want them, use another language when they're designed in well, not hacked on.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  7. Re:Slow Adoption of Current Standards by Anonymous Coward · · Score: 5, Informative

    Visual Studio added stdint.h not to comply with C, but to comply with the pending new C++ standard. Microsoft has publicly declared that they have no intention of supporting anything past C95 (basically ANSI C circa 1989 with a few tweaks).

    So some of the coolest things in C99 and C11, like named initializers, compound literals, etc, will never be in Visual Studio, because C++ has refused to adopt those features from C.

  8. Re:Slow Adoption of Current Standards by shutdown+-p+now · · Score: 5, Informative

    Visual Studio is explicitly a C++ implementation, and does not focus on C support. It has what effectively amounts to C89 support, but that's a legacy thing. Any support for C99 and C11 features is purely accidental, and usually happens when some header is required by both C99/C11 and C++11 (hence why it's just headers and never language features).

    In the meantime, other implementations, which actually care about C as well and C++ - like gcc or clang - add C11 support fairly quick.

  9. Re:Who needs threads? by Mr+Thinly+Sliced · · Score: 5, Informative

    IIRC it's because without putting explicit constraints on the memory model (needed for threading), you end up with holes of varying sizes when talking to memory from threads.

    It's mostly to do with CPU caching / memory barriers and having a consistent temporal view of data in and out.

    If it's not in the language, you end up with each platform/compiler having their own approach to barriers / atomics which makes glueing different bits of code together with different approaches a crap shoot when it comes to consistency.

    Here's a good place to start

  10. 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.