Article View: comp.std.c
Article #5672Re: portability
From: Ray Butterworth
Date: Wed, 25 Jan 1989 18:02
Date: Wed, 25 Jan 1989 18:02
39 lines
2177 bytes
2177 bytes
In article <877@auspex.UUCP>, guy@auspex.UUCP (Guy Harris) writes:
> > Does _flsbuf need to be rewritten to call __write() or
> >something similar
> Yes.
> >where __write is implemented as:
> No. What I think AT&T plans to do for S5R4, for example, is to *rename*
> the "write" routine "_write", and have a mechanism by which the linker
> will let "_write" satisfy unresolved references for "write" (or
> something like that); this means programs that call "write" and expect
> it to be the "write" in the system library will not have to be changed -
> but neither will programs that have their own private "write".
It seems to me that every implementor of a library other than
the Standard C library is going to need a means of having
alternate names for its functions (unless none of them call
each other). If not, it means that for anyone using part of
a large library all the identifiers in the library become
reserved words that he must be aware of.
Thus, unless one wants to have library source that look like:
write(args) { return __write(args); }
__write(args) { implementation of normal write function }
and have all user calls carry double the calling overhead,
every compiler writer is going to have to come up with a
mechanism for doing this aliasing. And every library implementor
(unless he also controls the compiler) is going to be out of luck.
At least I, as a library implementor, don't know of any nice way
of doing this without making changes to the compiler.
I don't understand why the C Standard didn't require, or at least
suggest, some such standard mechanism.
e.g.
write(args) entry __write { c_blah c_blah }
i.e. the resulting assembly code should look something like:
write:
__write:
a_blah
a_blah
Technical Details
Message-ID:
<23254@watmath.waterloo.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!rbutterworthReferences:
<16573@iuvax.cs.indiana.edu> <9419@smoke.BRL.MIL> <86097@sun.uucp> <877@auspex.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!rbutterworth From: rbutterworth@watmath.waterloo.edu (Ray Butterworth) Newsgroups: comp.std.c Subject: Re: portability Message-ID: <23254@watmath.waterloo.edu> Date: 25 Jan 89 18:02:13 GMT References: <16573@iuvax.cs.indiana.edu> <9419@smoke.BRL.MIL> <86097@sun.uucp> <877@auspex.UUCP> Organization: U of Waterloo, Ontario Lines: 39