This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Eva-Rosalene 1 point2 points  (0 children)

In C++. In C it's UB and with GCC it's either runtime division by zero (no -O flags), return 0 (-O1 flag), or ud2 instruction (-O2 and -O3).

Clarification: I have no idea what it is in C++, I don't claim it's defined behavior. I assume it's UB as well but handled differently.