Frustrated trying to be portable

Richard Tobin richard at aiai.ed.ac.uk
Wed Feb 20 05:18:43 AEST 1991


In article <15240 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>No compiler should be advertised as conforming to the (ANSI/ISO) C standard
>unless it fully meets the requirements for a conforming implementation
>specified in the standard.

This is obviously true.

>There are two kinds of conforming implementation:
>hosted and standalone.  The one you are interested in would be a conforming
>hosted implementation.  Certainly such an implementation would have to
>provide <stdlib.h>, remove(), etc.

As far as I can tell, some of the library functions described in the
standard can be implemented portably (requiring in some cases a
particular operating system), whereas some others can't.  For example
the functions from <string.h> and <stdio.h> can, whereas those in
<stdarg.h> can't.

This isn't however the distinction between a hosted and freestanding
implementation, since a freestanding implementation doesn't have to
provide <setjmp.h> and perhaps other non-portable libraries.

A compiler that provided only the non-portably-implementable library
functions (and headers) might well be very useful in a hosted
environment.

-- Richard
-- 
Richard Tobin,                       JANET: R.Tobin at uk.ac.ed             
AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed at nsfnet-relay.ac.uk
Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin



More information about the Comp.std.c mailing list