Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming

A New C Standard Is On the Way 305

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."
This discussion has been archived. No new comments can be posted.

A New C Standard Is On the Way

Comments Filter:
  • by Anonymous Coward on Monday June 25, 2012 @05:27PM (#40444719)

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

  • by Anonymous Coward on Monday June 25, 2012 @07:09PM (#40446049)

    Which is ironic, because Microsoft's Visual Studio team has stated they have no intention of supporting anything newer than C95. I don't understand why Microsoft is even allowed representation on the ISO committee.

    And the bounds-checking API which Microsoft "contributed" is useless. It's clunky, and requires more boilerplate coding than just using the standard interfaces with proper bounds checking. Plus they added a completely new errno_t typedef, which will probably breaks tons of existing code. Not to mention that not even Microsoft supports the API. The Win32 precursor to Annex K is incomplete and inconsistent. In other words, Annex K is dead in the water. Microsoft won't support it, and the BSD and GNU libc take completely different approaches.

  • by Anonymous Coward on Monday June 25, 2012 @07:31PM (#40446397)

    Clang only ever looked dated compared to VC++ because the damn thing wasn't even finished yet. I doubt VC++ will ever catch up again with it, though. Clang in a relatively short time managed to go from barely able to compile C++03 to possibly the most complete implementation of C++11.

  • Re:I don't get it... (Score:4, Interesting)

    by jd ( 1658 ) <imipak@yahoGINSBERGo.com minus poet> on Tuesday June 26, 2012 @03:50AM (#40449801) Homepage Journal

    I used Ada some time back. It's a nice object-based language (not OO, object-based) but its strictness could sometimes be infuriating. Good, but infuriating.

    I wouldn't want C to go in the direction of Ada - yes, the safety of C needs improving, but I regard C as being increasingly a universal starting point, a theoretical third-generation language rather than an actual one. There are now many dialects of C and many spin-off languages, some using that starting point better than others. It's a bit like the Cambrian Explosion, only the offshoots can still borrow from the central stem.

    Ada, however, is highly architectured, like Occam. Architectured languages are intended for very specific purposes and fulfill those purposes extremely well. Well, when they've been architectured correctly, that is. They've traded in the theoretical base point and the benefits of evolution for the benefits of being highly predictable and highly dependable within their niches. A well-written Ada program has levels of assurance on reliability that no C program could have -- or ever should have, because to have that level of assurance would kill off the very thing that makes C so powerful, which is the rate at which it evolves and de-standardizes. (Destandardization means you can exploit and assimilate new ideas faster. C is The Borg.)

  • by serviscope_minor ( 664417 ) on Tuesday June 26, 2012 @05:08AM (#40450109) Journal

    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.

  • Re:Missing features (Score:4, Interesting)

    by serviscope_minor ( 664417 ) on Tuesday June 26, 2012 @05:31AM (#40450213) Journal

    gcc is pretty good at vectorisation, provided it can prove a lack of aliasing (which is very, very hard).

    If you make heavy use of statically sized C-style arrays allocated on the stack, proving a lack of aliasing is much easier, and gcc generates vectorised code pretty well.

    What gcc can't do is specially tag pointers allocated from malloc() as somehow similar to stack allocated arrays and assume that they don't alias in the same way. I think thbe intel compiler is much better at that, which is where many of the gains come from.

    GCC is getting better however. In some cases it can prove that malloc()/free() pairs haven't achieved anything and elides them entirely. However the functionality seems pretty new and incomplete and ti doesn't work with new/delete yet.

UNIX is hot. It's more than hot. It's steaming. It's quicksilver lightning with a laserbeam kicker. -- Michael Jay Tucker

Working...