[comp.lang.c] definition of C

flaps@dgp.toronto.edu (Alan J Rosenthal) (07/09/90)

kaleb@mars.jpl.nasa.gov (Kaleb Keithley) writes:
>Well, I tried it on as many compilers as I could get my hands on, and they
>all worked.  I'd call that *empirical* proof.  As opposed to the other,
>which walk, talks, and smells like a theoretical proof.  In the world where
>I work, the doc's, standards, and manuals frequently say one thing, while
>the actual tool does something else.  So I've come to rely on not taking
>"...the book says..." as gospel.

This all comes down to what you think C is.  If you think C is the union (or
intersection) of all existing C environments, I guess the discussion ends
there.  Good luck in having your programs run on C environments which haven't
yet been created, since you can't possibly plan for them, since you can't
determine their characteristics empirically.

On the other hand, some of us believe that C is more properly deemed to be an
abstract idea, and consider different compilers to implement C to varying
degrees of correctness.  We're certainly willing to program around compiler
bugs (the fact that you're right and the compiler is wrong doesn't help your
program run in real life), but we're not willing to write things that we
consider incorrect C just because they work on all environments we know about.
We want our programs to run on all machines which correctly implement C (or at
least correctly enough to compile our programs correctly), in the present and
in the future, whether or not we know about them, now or ever.


Incidentally, he also writes:
>It also strikes me that what may be missing from the standard is a statement
>along the lines of "... use of exit() from main() is illegal..."

This would certainly violate their idea of not breaking existing programs.
Calling exit() from main() is perfectly valid C, although I don't do it
myself.

ajr