ANSI C standard library

deron meranda meranda at iguana.cis.ohio-state.edu
Wed May 1 13:41:13 AEST 1991


In article <695 at taumet.com> steve at taumet.com (Stephen Clamage) writes:
>There have been a number of postings and some private mail regarding my
>comments that almost all of the ANSI C library can be written in
>strictly-conforming C.  Only three functions have been identified as not
>possible to write -- setjmp, longjmp, and (being VERY strict) memmove.
>
>The comments challenging my statement generally confound the concept of
>"strictly conforming" with "completely portable".  The two concepts
>are not the same.
>
>Strictly-conforming C code may call an external function not supplied
>with the translation unit:
>...

This is all very true.  Most of the C library can indeed be written in
strictly-conforming C, although we may need to use external functions
to accomplish this.

However, perhaps a more informative question would be how much of the
C library can be written ENTIRELY in strictly conforming C without
the help of other external functions.  Again, however this is quite
different than the question of portability.

For example, consider the function strchr (section 4.11.5.2).  Clearly
if it were implemented entirely in C, it has to produce a plain char *
from a const char *.  Although most compilers will allow this with a
warning, it is not strictly-conforming C.

Understanding these kinds of problems are more important to me in
implementing the C library in C than realizing that some functions
require some external support.  So how does the library stand
against this criterion?


Deron E. Meranda  ( meranda at cis.ohio-state.edu )



More information about the Comp.std.c mailing list