Questions on X3J11 draft

Gregory Smith greg at utcsri.UUCP
Sat Dec 20 05:39:19 AEST 1986


In article <5449 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <780 at wjvax.wjvax.UUCP> brett at wjvax.UUCP (Brett Galloway) writes:
>>My real question is in implementation -- are there any loaders/compilers which
>>(stupidly) link in text which is referenced in an extern but not used?
>
>Yes, there are, but a simple trick in the compiler can avoid generating
>references to unused external names.

Scratch the 'stupidly'. This is widely used as a mechanism to force loading
of startup code ( E.g. the code that calls 'main' ). Besides, the
decision of whether or not to load stuff must often be made before
references are resolved. As Doug says, this is better done in the
compiler ( I wouldn't call it a 'trick'...).

I guess the compiler/loader combination would be 'stupid' if unused
externs caused loading.

-- 
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg
Have vAX, will hack...



More information about the Comp.lang.c mailing list