Kenneth Brody wrote On 08/27/07 13:45,:
Eric Sosman wrote:
[...]
When pressed, Jacob admits that his compiler supports
"C with extras" in addition to (he says) Standard C. He
does not claim that operator overloading and String and the
rest are part of C -- and that's attributable, at least in
part, to the existence of the Standard. In the B.O.D. people
*did* just add new gadgets to their implementations and call
the result "C," and since there was no arbiter to say otherwise,
they got away with it.
[...]
Well, what is the definition of a "C compiler"? I assume that it
means it will properly compile any conforming C program. I do not
assume that it means it will fail to compile any and all non-
conforming programs, nor that it contains no extensions to the
Standard.
The Standard defines C implementations.
... and that's my point: Without the definitions (which
the O.P. thinks of as restrictions), you get anarchy. This
is no ivy-covered ivory-tower prediction, but based on
actual experience: We *did* get anarchy.
The Standard says that strchr() and its friends are
declared in <string.h>. It does not forbid an implementation
from providing a <strings.h> header in addition, but it saves
the programmer from having to write
#if defined(PLATFORM_X) || defined(PLATFORM_Y)
#include <strings.h>
#else
#include <string.h>
#endif
Yes, we had to do this -- and worse -- in the Bad Old Days.
Now, we don't need to.
The Standard gives the rules for macro substitution, so
we no longer need to worry that the insides of a string
literal will be macro-replaced, as we did in the B.O.D.
The Standard promises that free(NULL) is safe, which was
not always so in the B.O.D. The Standard requires sprintf()
to return a count; some in the B.O.D. returned a pointer.
The Standard separates the names of one struct's elements from
those of another struct; B.O.D. C compilers varied in this
regard. And so on, and so on: the Standard "restricts the
language" in order to define it, and thus give the programmer
a chance to do more programming and less porting.
I do not claim that the Standard has made a bed of roses
for programmers, but I *do* say that it has removed an awful
lot of the thorns. It has restricted us from feeling those
thorns in inconvenient parts of our anatomies.
My *nix boxes have perfectly good C compilers on them, even though
I can open() files and communicate via TCP/IP sockets. I believe
that the man pages on these "extra" features don't state that they
are part of ANSI C, but rather that they are part of some other
standard (if appropriate), or that they are an extension from some
other source.
I don't believe that they need to be called "C (with extras)
compilers".
On the other hand, I see the OP has not posted any replies to this
thread as of yet, over 2-1/2 days later.
From the first I thought he might be a troll, but amid
all the foolishness there was what seemed to be an actual
frustration with the "restrictions" imposed by the Standard.
But now I'm starting to think I should have sent the Three
Billy Goats Gruff in his direction.