4 ms·
Linkers could require that all definitions of inline functions be byte-for-byte identical, but in practice people expect to be able to use libraries that were n
by plorkyeran 2y ago
Linkers could require that all definitions of inline functions be byte-for-byte identical, but in practice people expect to be able to use libraries that were not built with exactly the same compiler binary. Any check looser than that is trying to determine if two bits of machine code are sufficiently equivalent, which is distinctly not easy.
Static analyzers tend to be structurally unable to detect ODR violations - either they only analyze one translation unit at a time, or their cross-module analysis itself relies on the ODR being obeyed.