Look out: Divergent representations are everywhere
blog.trailofbits.com
blog.trailofbits.com
I mean... It is pretty actionable TBH. There are sanitizers you can use to detect UB. You could use a memory safe language. You could use a fuzzer. You could improve your test coverage. You could use static analysis tools. All of these can help reduce the chance of UB in your program.
UB in C is a dynamic behaviour, not something that can be detected by static analysis. A lot of it is triggered for example by certain values in passed-in parameters or other implicit state consumed by functions. And flagging any potential UB that might be caused by bad inputs is would yield so many positives that it's unworkable.
See eg "There is No Reliable Way to Determine if a Large Codebase Contains Undefined Behavior" section in http://blog.llvm.org/2011/05/what-every-c-programmer-should-...
Yes it is. Stop using C.