It&#x27;s usually only at runtime rather than compile time that such situations arise.<p>At runtime we have the clang and gcc undefined behaviour sanitizers, but they aren&#x27;t free in terms of performance.