Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!dartvax!vizard From: vizard@dartvax.UUCP (Todd Krein) Newsgroups: comp.sys.ibm.pc Subject: Re: Bug in link - I think there's something to this! Message-ID: <5860@dartvax.UUCP> Date: Wed, 18-Mar-87 16:15:39 EST Article-I.D.: dartvax.5860 Posted: Wed Mar 18 16:15:39 1987 Date-Received: Fri, 20-Mar-87 04:46:18 EST References: <373@ducall.UUCP> Organization: Dartmouth College, Hanover, NH Lines: 49 Summary: Yup, bug in link In article <373@ducall.UUCP>, jeff@ducall.UUCP (Jeffrey William Gillette ) writes: > [] > > Someone wrote recently about a problem with static arrays declared in > different modules. Amazing cooincidence, I just came across the same > type of problem with a static array in one module and malloced memory > in another. > > The code goes something like the following. The compiler is Microsoft > C. [rest deleted] Yup, there's a bug in link.... Found another one like it... code: extern float x[2000]; float x[2000]; main(){ . . . } file 2 code: extern float x[2000]; fred(){ . . . } Now the kicker.... I'm using a third party library (gasp, choke) which, I just discovered, declared x as an external integer! One might think that since the obj files define the length of the external variables, that the linker would complain about multiple def's and die. Nope, it sets x as an integer, and I go merrily writing over my variable space..... I'm also using MSC 4.0, and the libraray was (I'm told) done with MSC 3.0. Anyone got a fix for this? Todd Krein vizard@dartvax