Machine specific predefined names

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Feb 19 07:58:31 AEST 1988


In article <1988Feb17.115402.12739 at light.uucp> bvs at light.UUCP (Bakul Shah) writes:
>1) Is our local expert right?

Yes.

>2) If so, will companies such as SUN, AT&T, DEC etc. predefine
>   names such as _Sparc, _U3b2, _Vax in their ANSII C compilers?

Possibly they will, or maybe they could get together and decide
on how to register the values of unofficial standard vendor macros
such as __CPU__, __OS__, etc. (which don't yet exist!)  This would
be useful, but was outside the scope of X3J11.

>If the compiler vendor provides a system call library, is
>it considered part of an implementation?  If so, will the system
>calls have to be _Renamed?

No, here's the situation.  The C library can contain all sorts of
vendor-specific stuff, POSIX additions, etc..  However, since
all normal (non leading-underscore) external names not named in
the [proposed] standard are guaranteed to be available for use by
applications, none of the implementations of library functions
named in the ANSI C standard is allowed to refer to such an extra
external name, nor to any other external name that could cause
linking with a module containing such an extension.  This means
that virtually all existing C libraries will need to be revised
so that, for example, fopen() does not call open() but instead
calls _open(), for example, where "_open" is not tied to "open"
in the library.  There can be a separate module in the library
containing "open" (which could just branch to _open), however,
so long as the ANSI C implementation does not depend on it.



More information about the Comp.lang.c mailing list