Are any compiler vendors attempting to produce a C11 compiler?

Discussion in 'C Programming' started by Dann Corbit, Jul 10, 2012.

  1. Dann Corbit

    Dann Corbit Guest

    Since C99 support was spotty at best, with even the biggest compiler
    vendors putting very little effort into such a thing, I wonder if C11 is
    a paper-only, hypothetical standard or are there actual compiler vendors
    interested in making a functional C11 compiler.
    Dann Corbit, Jul 10, 2012
    1. Advertisements

  2. Dann Corbit

    Jorgen Grahn Guest

    Gcc 4.7 has a -std=c11 flag, so I guess the answers are "no" and "yes".

    Jorgen Grahn, Jul 10, 2012
    1. Advertisements

  3. Dann Corbit

    Dann Corbit Guest

    How much of the grammar of C11 do they support? Do they also cover the
    optional features? Do they support the new threading nomenclature?

    I have had some problems trying to get the 4.7 version to work properly
    to create 64 bit Windows binaries, so I am not currently using that
    Dann Corbit, Jul 10, 2012
  4. Dann Corbit

    Jens Gustedt Guest

    Am 10.07.2012 22:52, schrieb Dann Corbit:
    It looks that gcc and clang are actively moving towards implementing it.
    In contrast to C99 some parts of the old and new standard are now
    optional, so this will ease the transition for some compilers.

    Clang is actually already quite advanced in its C11 support, all direct
    language level features seems to be implemented, in particular _Generic
    and _Atomic.

    But as always with these things the required library support is more
    involved, so complete probably still will lack for a certain time. Some
    things are relatively "easy": support for atomics is already there in
    extensions with a different syntax, and implementing C11 threads on top
    of POSIX threads is not very difficult either, a good exercise for an
    experienced programmer.

    Jens Gustedt, Jul 10, 2012
  5. Dann Corbit

    Dann Corbit Guest

    Writing your own thread wrapper library is almost certainly a mistake.
    There is the existing ACE wrappers, there is the boost threading API,
    and there is the Pthreads wrapper also (which does not require C++ like
    the other two). All of these are tested and debugged and fairly easy to
    use. It would be nice (of course) to have a single threading API that
    can be used anywhere and this is likely the goal of these compiler
    advances (C++ beat C to the punch in having a standardized threading API
    but it is not universally implemented yet either).

    To roll your own version is another gob of code to maintain that
    supposedly is going to be replaced soon by "the real thing."

    If it never does get replaced then it was a complete waste of effort and
    if it does get replaced then it is a small waste of effort.

    In either case, I think I would train my energies on other portions of
    the project.

    I do most of my real programming in C++. For me, C is for hobby
    programming, mostly chess programs.

    I am, of course, interested in any new language features that make my
    life easier and I am especially interested in them if they actually come
    to fruition.
    Dann Corbit, Jul 10, 2012
  6. From the GCC documentation:
    A description of "incomplete and experimental", plus the lack of a
    compliance status page as there is for C99, doesn't inspire confidence.

    Stephen Sprunk, Jul 11, 2012
  7. Dann Corbit

    Jens Gustedt Guest

    Am 11.07.2012 00:08, schrieb Dann Corbit:
    If you happen to be on a POSIX system with gcc (clang, icc, opencc,
    ....) you don't have to provide that effort yourself, P99 already wraps
    existing features such that they mostly follow the C11
    interfaces. ("Mostly" for _Generic primary expressions that are
    emulated by P99_GENERIC, because the C11 syntax is not so easy to

    Have a look at

    So on POSIX platforms there is no excuse not to start new projects
    directly with C11 features.

    Jens Gustedt, Jul 11, 2012
  8. Dann Corbit

    Jorgen Grahn Guest

    Particularly that last part, yes. I certainly expected one to exist
    -- the C99 page seems so popular and successful as a way to advertise
    the level of support.

    However, the question was "are there actual compiler vendors
    interested in making a functional C11 compiler?", and the presence of
    a -std=c11 flag surely means they are at least /interested/.

    Jorgen Grahn, Jul 13, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.