We\'ve all heard the warnings that if you invoke undefined behaviour in C or C++, anything at all can happen.
Is this limited to any ru
If the behavior is undefined, the compiler could accept it, reject it, issue a warning, and according to the standard, even crash, hang or install a virus on your computer.
In practice, that does not mean if you are writing a compiler you should do those things on purpose, but you could, for example, use an algorithm which works on defined cases and crashes or hangs on undefined ones, if the performance advantage justifies it.
Still, a reputable compiler would avoid that, or at least have it very well documented.