Re: How C compilers handle multiple function definitions.

Mike Burrell <mburrel@uwo.ca>
Mon, 29 Dec 2008 13:04:01 -0500

          From comp.compilers

Related articles
How C compilers handle multiple function definitions. typingcat@gmail.com (RealCat) (2008-12-28)
Re: How C compilers handle multiple function definitions. armelasselin@hotmail.com (Armel) (2008-12-29)
Re: How C compilers handle multiple function definitions. mburrel@uwo.ca (Mike Burrell) (2008-12-29)
Re: How C compilers handle multiple function definitions. gah@ugcs.caltech.edu (glen herrmannsfeldt) (2008-12-30)
Re: How C compilers handle multiple function definitions. kamalpr@hp.com (kamal) (2009-01-01)
Re: How C compilers handle multiple function definitions. kamalpr@hp.com (kamal) (2009-01-01)
| List of all articles for this month |
From: Mike Burrell <mburrel@uwo.ca>
Newsgroups: comp.compilers
Date: Mon, 29 Dec 2008 13:04:01 -0500
Organization: University of Western Ontario
References: 08-12-107
Keywords: linker, comment
Posted-Date: 29 Dec 2008 15:55:01 EST

On 2008-12-28 21:12:00 -0500, RealCat <typingcat@gmail.com> said:


> If there are functions whose names are the same in object files and
> library files, what should happen during the compliation? Should this
> always cause a link error, or can C compilers make assumptions such
> as : "function definition in the object file has higher precedence
> over the one in the library file" or "the one in the previously linked
> library file has higher precedence over the ones in the library files
> linked later."?


Library symbols are usually defined as "weak". They are brought in to
resolve undefined references, but will not conflict with "strong"
symbols.
[I agree but the weak/strong terminology is usually used for the
references, not the definitions. Stuff in libraries is implicitly weaker
than in explicitly included modules. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.