This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] GCC tree linkage types
- From: Chris Lattner <sabre at nondot dot org>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: Daniel Jacobowitz <drow at mvista dot com>, <gcc at gcc dot gnu dot org>
- Date: Fri, 7 Nov 2003 10:09:39 -0600 (CST)
- Subject: Re: [C++] GCC tree linkage types
On Fri, 7 Nov 2003, Chris Lattner wrote:
> Ian Lance Taylor writes:
>
> > A weak undefined symbol is like an ordinary undefined symbol, except
> > that it is not an error if the symbol is never defined (and in that
> > case the symbol is implicitly defined with the value zero).
>
> What are weak undefined symbols used for? If they are referenced but
> never defined, how does the program link?
Sorry, I'm an idiot. What I meant to say was:
What are weak undefined symbols used for? If they are referenced but
never defined, how are they useful? Doesn't a dereference cause a trap?
Are things like:
if (pthread_create) { /* we have pthreads */ }
really used?
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/