www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Null references (oh no, not again!)

reply Burton Radons <burton.radons gmail.com> writes:
Walter Bright Wrote:

 Jason House wrote:
 IMHO, this type of thing is easy to understand.

Yeah, well, I still get regular emails (for the last 20 years at least) from the gamut of professional programmers at all levels of expertise who do not understand what "undefined symbol" from the linker means. It happens so often I am forced to consider the idea that the defect lies with me <g>. If I could figure a way to design *that* out of a linker, I would.

For every extern generate a weak symbol that does nothing but assert out with an error message; if it's properly resolved it goes away, if not then it's executed when the symbol is called. Now the linker isn't giving any errors. I actually remember doing that once! What the hell was I doing that for? Some kind of late binding malarkey maybe.
Mar 05 2009
parent "Nick Sabalausky" <a a.a> writes:
"Burton Radons" <burton.radons gmail.com> wrote in message 
news:gopodl$dne$1 digitalmars.com...
 Walter Bright Wrote:

 Jason House wrote:
 IMHO, this type of thing is easy to understand.

Yeah, well, I still get regular emails (for the last 20 years at least) from the gamut of professional programmers at all levels of expertise who do not understand what "undefined symbol" from the linker means. It happens so often I am forced to consider the idea that the defect lies with me <g>. If I could figure a way to design *that* out of a linker, I would.

For every extern generate a weak symbol that does nothing but assert out with an error message; if it's properly resolved it goes away, if not then it's executed when the symbol is called. Now the linker isn't giving any errors. I actually remember doing that once! What the hell was I doing that for? Some kind of late binding malarkey maybe.

That's sort of cheating, the error's still there, it's just gets shoved from build-time to run-time.
Mar 05 2009