You are tarring all compiler authors with a very broad brush here.<p>Myself and other compiler authors I work with are much more specific in their requests. We do actually define some behavior that the standard doesn&#x27;t require, and we do document this and tell our users its fine to rely on it.<p>Unfortunately, we also have a lot of really clear experience with this stuff that lead us to two conclusions:<p>1) When we identify UB in code and go look at that code, for very large bodies of code what we find are overwhelmingly bugs. Bad, complete bugs. Defining the behavior wouldn&#x27;t fix the bug, it was just one of the many symptoms.<p>2) We have real hardware differences for a lot of simple things that make them hard or impossible to give defined behavior for. As an example, shifting left by more bits than the size of the value gives different results on several different platforms.<p>None of this means that we don&#x27;t need to help programmers cope with this. We do indeed also make mistakes, and in fact it was these compiler authors that built a tool to help programmers find UB in their code:
<a href="http:&#x2F;&#x2F;clang.llvm.org&#x2F;docs&#x2F;UndefinedBehaviorSanitizer.html" rel="nofollow">http:&#x2F;&#x2F;clang.llvm.org&#x2F;docs&#x2F;UndefinedBehaviorSanitizer.html</a>