4 ms·
When two functions with the same name are ‘extern “C”’ for example, the compiler/linker will pick only one of them and which one is undefined. The choice could
by makecheck 6y ago
When two functions with the same name are ‘extern “C”’ for example, the compiler/linker will pick only one of them and which one is undefined. The choice could even change the next time you build. I’m not sure if compilers/linkers warn about this now but they certainly didn’t warn about it back when I first discovered this on a project.
And of course, the outcome ranges from nothing (if both copies happen to be identical), to slightly off (e.g. one dependency had a slightly older version of the function), to downright wrong (e.g. crash in this case).