1

A tool that checks every statement, declaration... and flag it if the standard says it is an undefined behaviour (e.g using an uninitialized int).

user2370139
  • 1,297
  • 1
  • 11
  • 13
  • Check out the sanitizer from clang (and gcc) – nefas May 29 '17 at 14:29
  • Try UBSAN (part of Clang). – Kerrek SB May 29 '17 at 14:30
  • Look for *static analyzers* for C++. Note that no single analyzer will be able to find *all* instances of UB, but running multiple (together with high warning levels from the compiler of course) should help you find most. – Some programmer dude May 29 '17 at 14:31
  • 1
    @Someprogrammerdude: I doubt it. There's quite a lot of run-time UB, especially now that we have threads. Using uninitialized ints across threads is a realistic risk, but hard to prove statically. – MSalters May 29 '17 at 15:02

0 Answers0