[from 'The problems in comp.lang.c']"Malcolm McLean said:
We're currently in the undesireable situation of having a rejected
standard, C99, which means that "standard C" is no longer the precise
thing it once was.
Correct. It totally undermines the value, status and meaning of the
standard and the standards committee itself. C90 is the standard.
C99 is some strange document that really doesn't mean anything.
[...] That doesn't mean it is impossible to hold a coherent discussion.
Indeed! People have actually posted here with answers to questions
that apply only to C99 and not C90! I.e., answers are given to
questions that actually cannot be used in practice! Who needs to do
actual programming anyways?
[...] I
don't think we can legitimately hold C99 to be off-topic, but we should
point out that non-block top declarations are not, de facto, portable.
Oh worse than that, they are pointless in a non-C++ environment.
"Declare anywhere" is a very specific work around in C++ to allow you
control over the order that constructors are called.
By their nature they heavily degrade the readability of code. If you
see a variable and want to know what type it is, you have to scan the
code sequence leading up to its use, rather than just the declaration
blocks.
I've looked at the differences in C99 according to the Wikipedia C article.
It doesn't look like that much to add to C90.
The variable length arrays were apparently killer to gcc. The whole
gcc porting effort was stopped because of that and other reasons.
So why the problem with creating compilers for it, is it motivation?
Primarily its because the standards committee has totally lost touch
with the real world of computer programming.
They did not, 1) attempt to assess the implementability of C99. They
also did not 2) assess the *value* of each feature to actual
programmers. And finally they did not 3) seek to encode features that
programmers need or want.
What is the most difficult part of C99 to implement?
Well, in the case of gcc, apparently the variable length arrays are
fatal, because some critical amount of the code out there that uses
gcc relies on the specific gcc semantics which conflict with C99's
VLAs.
Some of the extensions, like Complex support (I've never used complex
numbers and never will, and I'm sure many others will say the same) are
really not very interesting; perhaps that should have been optional if it
made producing the compilers easier.
Not only is it almost entirely useless (who the hell can't program up
their own complex numbers for crying out loud!), it conflicts with the
C++ template (namespace-wise) which does the exact same thing but is
more general (and therefore the C99 version *cannot* be taken forward
to C++).
Or is the real problem that there will always be C compilers that are not
C99 compatible,
By itself that is not an argument against C99. Many compilers did not
implement C90 or C89, however, we still consider C90 the de facto
standard because it was implemented by most compilers, and certainly
all the most popular ones. In fact being C90 compatible itself pretty
much assured compiler vendors that they would have *some* audience.
C99's failure is traceable most directly to the failure of the
committee to make a compelling enough standard to get sufficient by-in
by compiler vendors, or even programmers (who would, in turn, put
pressure on compiler vendors.) A good recent comparative example of
this is how the C++ standard was diligently implemented by most
vendors *except* Microsoft. Then bowing to user pressure, Microsoft
eventually acceded to their demands and they have implemented a fairly
compliant C++ compiler.
C99 isn't there. And C0x promises to do no better. In their
stupidity, the standards committee are listening to Microsoft, rather
than Microsoft's customers as to what to add to their next standard
and now we have this ridiculous "safer C library" nonsense that
everyone hates. I don't know of a single person anywhere who uses the
Visual C++ who doesn't turn off these new "safer" library functions,
and the false "deprecation" warnings they now emit. The C language
committee just happily endorses this even though Microsoft has made no
commitment to even implement the C99 standard.
[...] effectively breaking the standard because any supposedly
portable C99 code (does anyone else keep typing it as C((?) will not be
portable to those compilers?
Of course -- coding to C99, or *near* C99 breaks portability, because
there isn't a common subset of C99 that everyone pretty much agrees
on. The only real common denominator is C90 minus the new reserved
words in C99. In which case, why not just stick with C90? I think
the jury has spoken -- C99 doesn't give a reason for abandoning C90
and what portability it provides.