portability

Henry Spencer henry at utzoo.uucp
Sat Jan 21 03:38:28 AEST 1989


In article <86097 at sun.uucp> swilson at sun.UUCP (Scott Wilson) writes:
>... What happens
>to the names of routines used to implement standard library functions?
>Don't these pollute the name space?  Are implementations required to
>work around this?  For example can a pANS program with a routine
>called write() reliably be compiled and run on a UNIX system without
>causing printf (really _flsbuf) to call the user's routine and botching
>everything?  Does _flsbuf need to be rewritten to call __write() or
>something similar...

In a word, yes.  The name-space pollution situation was a major disaster
in the making, and X3J11 decided to call a halt to it.  A conforming
implementation can reserve those names specified in the standard, and
only those names specified in the standard (including those specified
as "reserved for future use").  All, repeat *all*, other names are open
for use by the user, and the user must be able to use any, repeat *any*,
other name without causing trouble.  Which means that any extra functions
needed by C-standard library functions must have names which are in
the "reserved for the implementation" space.
-- 
Allegedly heard aboard Mir: "A |     Henry Spencer at U of Toronto Zoology
toast to comrade Van Allen!!"  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list