Are any compiler vendors attempting to produce a C11 compiler?

D

Dann Corbit

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

Jorgen Grahn

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.

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

/Jorgen
 
D

Dann Corbit

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

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
version.
 
J

Jens Gustedt

Am 10.07.2012 22:52, schrieb Dann Corbit:
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.

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
 
D

Dann Corbit

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.

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

Stephen Sprunk

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

From the GCC documentation:
-std= ....
`c11'
`c1x'
`iso9899:2011'
ISO C11, the 2011 revision of the ISO C standard. Support is
incomplete and experimental. The name `c1x' is deprecated.

A description of "incomplete and experimental", plus the lack of a
compliance status page as there is for C99, doesn't inspire confidence.

S
 
J

Jens Gustedt

Am 11.07.2012 00:08, schrieb Dann Corbit:
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.

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

Have a look at http://p99.gforge.inria.fr/p99-html/group__C11.html

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

Jens
 
J

Jorgen Grahn

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.

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top