Finding ODR Violations with ORC

By Foster Brereton and Lee Thomason

C++'s One Definition Rule is one of the more obscure corners of the language. The problem with violating ODR is that it can lead to malignant application behavior that can be exceedingly difficult to root out. ODRs are also typically not found by tooling, as the Standard permits (and in some cases encourages) tooling to be silent about the violations it detects. In this talk, we cover the basics of the One Definition Rule, the ways in which build systems can cause ODR violations to happen, and finally ORC, a linker-wrapping tool that can be used to identify ODR violations in software.