Xref: utzoo comp.unix.wizards:23572 comp.lang.c:31304 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: OK, so why _does_ ld resolve text against data? Message-ID: <13647@smoke.BRL.MIL> Date: 22 Aug 90 21:06:08 GMT References: <37909@ucbvax.BERKELEY.EDU> <930@eplunix.UUCP> <141151@sun.Eng.Sun.COM> Followup-To: comp.unix.wizards Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 18 In article <141151@sun.Eng.Sun.COM> linden@eng.sun.com (Peter van der Linden) writes: >it's even more heinous than the example he gives. If you happen to >choose a function name that duplicates a library name, then your function >is used in preference to the library function both in your code AND in >any library routines you call! This is the primary reason why the C standard severely constrains the external-linkage identifiers that an implementation of the standard library is permitted to use. >Most of us know to avoid names like malloc, but everyone calls something >index sooner or later. This particular name is not a problem in a standard-conforming environment. In general, when you link with nonstandard libraries, name-space collision is a real possibility. Ways for library designers to reduce this risk have been discussed in the C newsgroup before.