On Fri, Feb 05, 2016 at 12:14:11AM +0000, tsbockman via Digitalmars-d wrote: [...] > This isn't even a particularly expensive (in compile-time costs) check > to perform anyway; all that is necessary is to store a temporary table > of symbol signatures somewhere (it doesn't need to be in RAM), and > check that any duplicate entries are consistent with each other before > linking.
That's a lot more expensive than you think. There's a reason most modern linkers do not do full cross-referencing of symbols -- because doing so would be excruciatingly slow and consume gobs of memory. Even a 32GB machine would not be able to hold *all* the symbols in some very large software projects, and looking things up on disk is unacceptably slow for software of those sizes. Most modern linkers instead use faster algorithms that rely on clever scheduling of the order of symbol resolution, just so they *don't* have to cross-reference all symbols at once. Besides, all this is unnecessary work. All you need to do is to have C compilers mangle function names. Mission accomplished. (However, this *will* break a lot of existing inter-language code that rely on being able to spell out symbols explicitly. So it probably will not fly. But, in theory, it *is* possible...) And to paraphrase one of my favorite Walter quotes: fixing inconsistent function signatures is only plugging one hole in a cheese grater. C has far more dangerous gotchas than just function signature mismatches. T -- They say that "guns don't kill people, people kill people." Well I think the gun helps. If you just stood there and yelled BANG, I don't think you'd kill too many people. -- Eddie Izzard, Dressed to Kill
