I don&#x27;t know if it&#x27;s guaranteed to bark on <i>all</i> possible cases of UB, but there we go:<p><pre><code>  $ cat test.c
  int main() {
          return *(int*)0;
  }
  $ gcc test.c -fsanitize=undefined -o test
  $ .&#x2F;test
  test.c:2:9: runtime error: load of null pointer of type &#x27;int&#x27;
  Segmentation fault
</code></pre>
I&#x27;m pretty sure I&#x27;ve seen similar tool based on clang as well.<p>And there is valgrind.