Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming

ISO Updates C Standard 378

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

ISO Updates C Standard

Comments Filter:
  • by JDG1980 ( 2438906 ) on Saturday December 24, 2011 @05:25AM (#38480428)
    Currently, Microsoft Visual Studio does not even support the C99 standard. Unfortunately, it's unlikely that this standard will be widely adopted any time soon when Microsoft seems to be content to let standard C wither and die.
  • Re:First post!! (Score:5, Informative)

    by Anonymous Coward on Saturday December 24, 2011 @05:29AM (#38480440)

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

  • by wdef ( 1050680 ) on Saturday December 24, 2011 @05:30AM (#38480446)
    C is withering and dying? Isn't it still used more than any other language: http://langpop.com/ [langpop.com]
  • by FrangoAssado ( 561740 ) on Saturday December 24, 2011 @06:20AM (#38480594)

    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 [open-std.org]

  • Re:So... (Score:5, Informative)

    by Old Wolf ( 56093 ) on Saturday December 24, 2011 @06:32AM (#38480638)
  • by JDG1980 ( 2438906 ) on Saturday December 24, 2011 @06:40AM (#38480658)
    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.
  • by Anonymous Coward on Saturday December 24, 2011 @06:50AM (#38480680)

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

  • by ibsteve2u ( 1184603 ) on Saturday December 24, 2011 @06:53AM (#38480686)

    The standard is known unofficially as C1X

    GCC already says: [gnu.org]

    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.

  • by Anonymous Coward on Saturday December 24, 2011 @07:07AM (#38480728)

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

  • by Anonymous Coward on Saturday December 24, 2011 @07:50AM (#38480826)

    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.

  • by rev0lt ( 1950662 ) on Saturday December 24, 2011 @08:08AM (#38480910)
    Actually, C# is as proprietary as C - it isn't. Check http://msdn.microsoft.com/en-us/netframework/aa569283 [microsoft.com] 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) [wikipedia.org].
  • Re:First post!! (Score:5, Informative)

    by TheRaven64 ( 641858 ) on Saturday December 24, 2011 @08:28AM (#38480998) Journal
    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.
  • by TheRaven64 ( 641858 ) on Saturday December 24, 2011 @08:33AM (#38481018) Journal
    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.
  • Re:First post!! (Score:5, Informative)

    by wzzzzrd ( 886091 ) on Saturday December 24, 2011 @08:35AM (#38481028)
    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 [thepiratebay.org].
  • Re:So... (Score:5, Informative)

    by TheRaven64 ( 641858 ) on Saturday December 24, 2011 @08:45AM (#38481068) Journal
    As with every other version of the C standard, you can read the draft yourself [open-std.org]. 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).

  • by shutdown -p now ( 807394 ) on Saturday December 24, 2011 @09:53AM (#38481332) Journal

    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.

  • Re:First post!! (Score:4, Informative)

    by bonch ( 38532 ) * on Saturday December 24, 2011 @02:15PM (#38483296)

    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 [stallman.org] and "voluntary pedophilia" [stallman.org]. Maybe not the best spokesperson to get behind.

Scientists will study your brain to learn more about your distant cousin, Man.

Working...