utility of ANSI C (was:__STDC__ defined as zero a problem)

Doug Gwyn gwyn at smoke.BRL.MIL
Tue Jun 27 18:13:44 AEST 1989


In article <2029 at dataio.Data-IO.COM> bright at dataio.Data-IO.COM (Walter Bright) writes:
>In other words, ANSI C is a specification for a common subset, but
>customers demand more than that for their real work.

The proposed ANSI Standard for C in a hosted environment describes a
richer language and run-time library than portable applications have
been able to rely on hitherto; it is by no means a "common subset".

Vendors can add compatible extensions and remain Standard conformant.
Obviously most vendors will do exactly that.  Most non-conforming C
implementations over the next few years will be intended primarily to
provide "backward compatible" support for vendors' customers who have
already invested heavily in applications based on C support that has
been "disallowed" by the Standard.  It is possible for vendors to
mutate such features into Standard conforming form, but it will take
time for existing applications to be converted.

An example of a compatible extension is the set of features constituting
IEEE Std 1003.1.  It is actually rather easy to add such extensions.
Language extensions (such as memory-model type qualifiers) can also be
added, so long as no conforming application will have its meaning
changed by the extensions; the simplest approach is to use new keywords
starting with underscores, such as "__near".  The use of these in code
can be beautified via macros defined in a vendor-supplied header, if
desired.

The only major constraint imposed by the Standard in this respect is
that the standard headers may not contain just any old garbage the
vendors felt like sticking in them; thus when an application includes
a standard header, it knows the extent of the name space infringement
that is possible thereby, and it can readily be designed to work
correctly in all permitted cases.  Without such a constraint, no such
guarantee could be assumed, and thus portable C programming would be
greatly hindered.  In my estimation, control over vendor pollution of
C's name spaces is one of X3J11's greatest accomplishments.



More information about the Comp.lang.c mailing list