Slashdot Mirror


ISO Updates C Standard

An anonymous reader writes "The International Organization for Standardization (ISO) has published the new specifications for the C programming language. The standard is known unofficially as C1X and was published officially as ISO/IEC 9899:2011. It provides greater compatibility with the C++ language and adds new features to C (as indicated in the draft)."

40 of 378 comments (clear)

  1. First post!! by Anonymous Coward · · Score: 5, Insightful

    Actually, who cares about that?

    Seriously, though, am I the only one who finds it strange that one has to buy copies of the standard?

    1. Re:First post!! by symbolset · · Score: 5, Insightful

      Actually though, most of us. Changes to the C standard are a big deal.

      --
      Help stamp out iliturcy.
    2. Re:First post!! by Anonymous Coward · · Score: 3, Funny

      Do they sell them by the C-shore?

    3. Re:First post!! by Anonymous Coward · · Score: 5, Informative

      Oh? $300? For a PDF file? Heh.

    4. Re:First post!! by JustOK · · Score: 5, Funny

      yes, if you have 300 clams.

      --
      rewriting history since 2109
    5. Re:First post!! by dutchd00d · · Score: 4, Insightful

      Not really, a lot of books cost money. Why would this one be different?

      First of all, it's not a book. It's a PDF. Second of all, the Netherlands is a member body of ISO, so I have already paid for it through my taxes. I should be able to use the fruits of ISO without additional cost (or maybe some nominal fee). Third of all, an ISO standard has the status of a law: you'd better do it this way, or else. So they're telling me the law has changed, and then charging me 300 euros to find out precisely what the new law is. I believe that's called extortion.

    6. Re:First post!! by Noughmad · · Score: 5, Funny

      The new standard have been on display for free at the Alpha Centauri planning office for the last fifty years.

      --
      PlusFive Slashdot reader for Android. Can post comments.
    7. Re:First post!! by 93+Escort+Wagon · · Score: 4, Funny

      Oh? $300? For a PDF file? Heh.

      But these limited-edition PDFs are signed and numbered.

      --
      #DeleteChrome
    8. Re:First post!! by TheRaven64 · · Score: 5, Informative

      The last draft and the errata are always free downloads. That's what I've been using to implement the atomics stuff in clang / FreeBSD.

      --
      I am TheRaven on Soylent News
    9. Re:First post!! by wzzzzrd · · Score: 4, Informative

      It's 300 bucks, it was produced by a committee financed by tax payer's money, it's a pdf, not even a printed book. It's an open standard and will be needed by a lot of developers who want or must write standard compliant code. This is EXACTLY the thing RMS means when he is shouting his song.

      Grab the original file from here.

      --
      On second thought, let's not go to Camelot. It is a silly place.
    10. Re:First post!! by NekSnappa · · Score: 3, Funny

      I think you meant c-shells.

      --
      I want to shoot the messenger!
    11. Re:First post!! by bunratty · · Score: 4, Insightful

      You're not paying for just the production or distribution of the file, book, movie, music, software, or drug when you pay for those things. You're paying for the effort required to make the item in the first place. If it takes someone one year to write a book, they need to recieve much more than the cost of distributing a PDF file to make a living from writing.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    12. Re:First post!! by Vanders · · Score: 3, Funny

      Developers can't write standards compliant code without knowing what the standards are.

      Oh what am I saying? Developers won't write standards compliant code even if they do know what the standards are!

    13. Re:First post!! by bonch · · Score: 4, Informative

      This is EXACTLY the thing RMS means when he is shouting his song.

      Of course, when he's not doing that, he's advocating necrophilia and "voluntary pedophilia". Maybe not the best spokesperson to get behind.

  2. Re:Let's get C99 right first by wdef · · Score: 4, Informative

    C is withering and dying? Isn't it still used more than any other language: http://langpop.com/

  3. Re:Let's get C99 right first by Daniel+Phillips · · Score: 5, Interesting

    Who cares about Microsoft these days? Any damage they cause by lagging behind standards is only to themselves, unlike the bad old days. In the modern world GCC is the bar by which Microsoft is measured, and usually found lacking.

    --
    Have you got your LWN subscription yet?
  4. move on by OrangeTide · · Score: 4, Insightful

    Many of us gave up waiting on Microsoft for our development tools.

    --
    “Common sense is not so common.” — Voltaire
  5. Re:Let's get C99 right first by Feltope · · Score: 4, Insightful

    COBOL is king, always will be.

    Solid and reliable code that works period!

    --
    thanks, Feltope
  6. Draft available for free by FrangoAssado · · Score: 5, Informative

    For those interested, the last draft before the official version is available for free here: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

  7. Re:Let's get C99 right first by hairyfeet · · Score: 3, Insightful

    Don't forget to use the magic uncripple settings if you do that Mr AC or you'll be tying a boat anchor to every non Intel chip that tries to run you code.

    --
    ACs don't waste your time replying, your posts are never seen by me.
  8. Re:So... by Old+Wolf · · Score: 4, Informative
  9. Re:Let's get C99 right first by JDG1980 · · Score: 4, Insightful

    Microsoft wants C to die. No one else is cooperating with them on this. As a result, Windows developers are stuck with worse tools for C than developers on almost any other platform. (Yes, there's MinGW, but it's a real pain and does not support many newer Windows APIs at all.)

  10. Re:Let's get C99 right first by JDG1980 · · Score: 3, Informative

    Unfortunately, the damage goes beyond that. You can't effectively use GCC (MinGW) to build most Windows applications, not only because these applications are full of Visual C++isms, but also because many newer APIs (notably Direct2D and DirectWrite) are not currently supported under MinGW at all.

  11. Re:Let's get C99 right first by Anonymous Coward · · Score: 4, Informative

    "This includes even the most basic stuff, like declaring variables in the middle of your code. It's actually a GCC extension to C"

    No it's not— it's part of ISO C99.

  12. Looks like story is already dated... by ibsteve2u · · Score: 4, Informative

    The standard is known unofficially as C1X

    GCC already says:

    A fourth version of the C standard, known as C11, was published in 2011 as ISO/IEC 9899:2011. GCC has limited incomplete support for parts of this standard, enabled with -std=c11 or -std=iso9899:2011. (While in development, drafts of this standard version were referred to as C1X.)

    Syntax is everything in C.

    --
    Orwell: "In a Time of Universal Deceit, telling the Truth is a Revolutionary Act"
  13. Re:Let's get C99 right first by kthreadd · · Score: 3, Insightful

    If your program relies on the presence of GCC extensions, you did it wrong in the first place.

  14. Poul-Henning's take on this. by Anonymous Coward · · Score: 5, Informative

    https://www.varnish-cache.org/docs/trunk/phk/thetoolsweworkwith.html

    1. Re:Poul-Henning's take on this. by shutdown+-p+now · · Score: 4, Insightful

      His complaint about _Noreturn and similar keywords is silly. First, they were there 12 years ago already, in C99 - _Bool, _Complex etc. The reason for this scheme is that if they just made noreturn a keyword, existing valid C programs that use it as identifier would become illegal. On the other hand, underscore followed by capital letter was always reserved for implementations, so no conforming program can use it already. And then you can opt into more traditionally looking keywords, implemented via #define to the underscore versions, by explicitly including the appropriate header.

  15. Re:Let's get C99 right first by Freestyling · · Score: 4, Interesting

    Hi, I'm a Windows developer.

    I'll take C# over C any day, and I have 20 years of C experience.

    I believe that's kinda the parent poster's point. For a windows developer MS make their proprietary C# language easy, and C hard work. Now for most stuff that's fine, but sometimes a lower level language is needed. Ever tried writing a kernel mode driver in C#?

  16. Re:Let's get C99 right first by Anonymous Coward · · Score: 3, Informative

    For a windows developer MS make their proprietary C# language easy, and C hard work. Now for most stuff that's fine, but sometimes a lower level language is needed.

    Interesting, it's like you've never heard of C++ which MS does fully support [slowly] and is standard. I know pure C is a sacred cow but writing pure procedural code in C++ won't kill you, in fact, it will probably make the code much easier to read since you can't just arbitrarily cast back and forth between void pointers and other types without explicit type brackets.

    Ever tried writing a kernel mode driver in C#?

    MS has been experimenting with that but it seems more likely that they'll just hoist most drivers into user space services so you can use any language, .Net based or not. They've already hoisted some USB drivers and the bulk of WDDM video card drivers, just backwards compatibility in the way for the rest.

  17. Re:Let's get C99 right first by rev0lt · · Score: 4, Interesting

    The solidity and reliability of COBOL code comes from decades of correcting bugs and lack of features of most applications that are still in use today. And yes, I've worked professionally as a COBOL programmer.

  18. Re:Let's get C99 right first by Richard_at_work · · Score: 4, Interesting

    Not being a C or C++ developer, I'm not sure who to believe - in the Firefox compilation story a few days ago, there were a fair few highly modded up posts extoling the virtues of the quality and speed of binaries output by the MS C and C++ compiler over GCC.

    Any thoughts on that?

  19. Re:Let's get C99 right first by rev0lt · · Score: 4, Informative

    Actually, C# is as proprietary as C - it isn't. Check http://msdn.microsoft.com/en-us/netframework/aa569283 for the ISO standard details regarding C#.
    Microsoft .NET implementation is proprietary, but there is an early open source release of the .NET CLI implementation codenamed "Rotor", for XP, FreeBSD and MacOS X. Additionally, the Mono project is an opensource clean-room implementation, but it may not be feature-complete.

    Microsoft Research has an interesting project called Singularity - an operating system running (mostly) in managed code. Some initialization routines are done in Assembly/C/C++, but the kernel itself and respective drivers are written entirely in managed code. Check http://en.wikipedia.org/wiki/Singularity_(operating_system).

  20. Re:Let's get C99 right first by TheRaven64 · · Score: 3, Informative

    GCC? People still use that? Clang can now parse a lot of the standard windows headers. 3.1 should have finished implementing the required quirks to understand the Windows templates. There's also work underway to support the Win64 exception model, which will hopefully be done by the 3.1 release.

    --
    I am TheRaven on Soylent News
  21. Re:So... by TheRaven64 · · Score: 4, Informative
    As with every other version of the C standard, you can read the draft yourself. A few things that are nice:
    • A detailed and well-thought-out set of atomic operations. I've got a diff for clang that implements these that should be committed in the next few days after a bit of tidying. Ed Schouten has written the supporting header to FreeBSD libc, so these can be used now (with fall back to GCC intrinsics for a marginally slower implementation).
    • Unicode string literals and a few functions for manipulating them.
    • _Generic() letting you write type-generic macros.
    • Anonymous structure and union members, so you can write things like struct { int tag; union { void *ptr; uintptr_t i}; } s; and then refer to s.ptr or s.i, rather than needing to provide a name for the union (this is already a GNU extension, but it's nice to have it in the standard).
    • Static assertions, so you can do things like _Static_assert(sizeof(int) == 4, "This code path should not be used in ILP64 platforms!"); and get a compile-time error if it is.
    • A _Thread_local storage qualifier for thread-local variables (equivalent to the __thread GNU extension).
    • Alignment checks and specifiers.
    • A few things from POSIX, like the x specifier in fopen() for exclusive open.

    Some of the not-so-nice features include threads.h, which is equivalent to pthreads but with a different function names (and ones that seem quite likely to cause conflicts with existing code).

    --
    I am TheRaven on Soylent News
  22. Re:Let's get C99 right first by shutdown+-p+now · · Score: 4, Informative

    Simply put, gcc beats VC on standard compliance, and VC beats gcc on optimization quality.

    Anyway, VC is primarily a C++ compiler. C support is largely legacy, and hasn't been updated for a long time now.

  23. Re:Can't we please let C die? by jcr · · Score: 4, Insightful

    You have that exactly backwards. It's C+++ that should die.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  24. WTF is "ISO C"? by Anonymous Coward · · Score: 3, Insightful

    I spent my early years programming K&R C on Unix systems.

    When the ANSI standards were ratified, ANSI took over.

    But WTF is "ISO C"? With a core language whose goal is portability and efficiency, why would I want the language trying to can platform-specific implementations like threading? C is not a general purpose language -- it's power comes from tying to the kernels and platform libraries of the industry at the lowest levels possible to maximize performance.

    If you don't need that maximum performance, you use C++ or another high-level language.

    ANSI C is the assembler of the modern computing age, not a general purpose programming language.

    Now get off my lawn!

  25. Most critical software is written in COBOL by perpenso · · Score: 3

    Real mission critical stuff at Boeing? NASA? All that stuff then right?

    Actually their most critical software is probably written in COBOL, their payroll software. Without that COBOL based software nothing gets done. :-)

  26. Re:My "Ask Slashdot" by bonch · · Score: 3, Funny

    Objective-C, of course.