Hacker News new | ask | show | jobs
by pmarin 1175 days ago
If they are bugs they should be reported to the user and end the compilation with an error.
1 comments

Compilers actually have some options to enable that.

The problem is, it only works well in the simplest cases when the code will 100% exhibit UB within a single function.

In most cases, the UB would only manifest on particular input values - if you want your compiler to warn about that then it will report one "potential UB" for every 10 lines of C code, and nobody wants to use such a compiler.