Path: utzoo!attcan!uunet!husc6!mit-eddie!mit-amt!hkbirke From: hkbirke@mit-amt (Hal Birkeland) Newsgroups: comp.sys.mac.programmer Subject: Re: LSC 3.0, argc & argv, linking Summary: Automatic "standard" function replacement can suck. Message-ID: <3005@mit-amt> Date: 8 Sep 88 00:00:34 GMT References: <66791@sun.uucp> <2391@pixar.UUCP> <67189@sun.uucp> Organization: MIT Media Lab, Cambridge, MA Lines: 22 > UNIX libraries (.a files) are composed of many separately compiled object > files (.o files). As far as I know the linker extracts only the .o files > needed to resolve references when linking. If you have your own strcpy, > for example, the linker will not get strcpy.o from the library because the > reference has already been satisified.... I ran into just such a replacement problem with one recent multi-person software project (we each wrote separate parts and then combined them together). Buried in the middle of one of my partners code was a definition for random (using longs, of course) which returned a random POSITIVE OR NEGATIVE integer. My code grabbed the library random (positive integer return value). The result was that my code crashed when compiled into the project, but ran fine on its own. If the library function was not automatically superceded, the error did not occur (even worse, the problem couldn't be solved until I ran "strings" on the other guys code). After all, YOU CAN NAME YOUR FUNCTIONS ANYTHING YOU WANT while the libraries are ALREADY DEFINED. Please rename the functions rather than reusing the existing symbol... -- hal