To avoid some linking errors

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 30 14:49:19 PDT 2012


On 10/30/12 5:40 PM, Brad Roberts wrote:
> On Tue, 30 Oct 2012, Andrei Alexandrescu wrote:
>
>> On 10/30/12 5:07 PM, Brad Roberts wrote:
>>> 1) Why did the compiler believe it would be?  If it didn't think it was a
>>> valid usable symbol, it would have already errored at the call site during
>>> semantic analysis.
>>
>> Not getting this at all. All I'm saying is that if the compiler says "I can't
>> find that foo() you're asking for", the most interesting piece of information
>> for me is "where did I ask for it?"
>
> Ok, so it points to a place in the code where you used it.  You look at
> that and say, yup, I did indeed use it.  Not surprising.

In the presence of overloading, that is most often surprising. And 
usually it's not "I" who uses it, it's transitively called by some code 
I write. That's the hardest part.

> Now, why doesn't
> the linker find it?

Because it's declared but not explicitly made part of the project.

> Why did the compiler believe it existed?

Grep takes care of that. Finding the declaration is never a problem.

> The site of the usage isn't remotely useful for answering either of those
> questions and those are the ones that form the disconnect between the
> compiler, who believed it existed and let the code pass to the next
> stage), and the linker.

Non-issue. Grep takes care of that. Finding the cross-references and the 
overloading part are the hard problems here. This is so clear to me for 
so many reasons, I am paralyzed by options.


Andrei


More information about the Digitalmars-d mailing list