(no title)
deathanatos | 12 days ago
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
zephen|12 days ago
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.
uecker|12 days ago