Here's a cogent argument that any decision by compiler writers that they can do whatever they wish whenever they encounter an "undefined behavior" construct is rubbish: https://www.yodaiken.com/2021/05/19/undefined-behavior-in-c-... And here's a cautionary tale of how a compiler writer doing whatever they wish once they encounter undefined behavior makes debugging intractable: https://www.quora.com/What-is-the-most-s…
> undefined behavior makes debugging intractable: By their own admission, the compiler warns about the UB. "-Wanal"¹, as some call it, makes it an error. Under UBSan the program aborts with: code.cpp:4:6: runtime error: execution reached the end of a value-returning function without returning a value … "intractable"? ¹a humorous name for -Wextra -Wall -Werror
The -Werror flag is not even religiously used for building, e.g. the linux kernel, and -Wextra can introduce a lot of extraneous garbage.
This will often make it easier (though still difficult) to winnow the program down to a smaller example, as that person did, rather than to enable everything and spend weeks debugging stuff that isn't the actual problem.