C linkage query

Richard Bumby bumby at math.rutgers.edu
Fri Jun 9 04:27:31 AEST 1989


In article <9449 at alice.UUCP> ark at alice.UUCP (Andrew Koenig) writes:

> Does anyone have a C compiler + linker incapable of handling this:
> 
> 	extern int foo;
> 
> 	main() { }
> 
> That is: are there any C implementations that turn an
> `extern' declaration for a variable that is never actually
> referenced into a genuine external reference that inhibits
> linking?
> -- 
> 				--Andrew Koenig
> 				  ark at europa.att.com

I'm not sure what you are asking, but I compiled your program with the
following results:

Aztec C 8086 Pass1 4.10c  4-3-88 (C) 1982-1988 by Manx Software
Systems, Inc.
Aztec C 8086 Pass2 4.10c  4-11-88 (C) 1982-1988 by Manx Software
Systems, Inc.
8086 Assembler Vers. 4.10c  3-29-88

ln linktest.o -lc
Aztec C Linker Version 4.10c  3-29-88
Code: 0505  FarData: 0000  Data: 0062  Udata: 010c  Total: 00067e

with file sizes as shown below

LINKTEST C         30
LINKTEST O         90
LINKTEST EXE     1906

The program also runs without complain (doing nothing, of course).
Maybe some time I will look at the result with a debugger to see what
is actually there.
-- 

--R. T. Bumby ** Math ** Rutgers ** New Brunswick **
(in one form or another for all kinds of mail)
[bumby at math.rutgers.edu]



More information about the Comp.lang.c mailing list