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

29 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: 5, Informative

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

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

      yes, if you have 300 clams.

      --
      rewriting history since 2109
    4. 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.

    5. 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.
    6. 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
    7. 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
    8. 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.
    9. 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.
    10. 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:So... by Old+Wolf · · Score: 4, Informative
  8. 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.)

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

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

  12. 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#?

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

  14. 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?

  15. 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).

  16. 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
  17. 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.

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