45 ms·
C/C++ (the standard) makes no claims about what happens if you overflow integers. The program might set all your variables in the whole program to zero if it li
by staunton 3y ago
C/C++ (the standard) makes no claims about what happens if you overflow integers. The program might set all your variables in the whole program to zero if it likes. Of course the compiler vendors wouldn't do that but they're allowed to. That's what "undefined" means at least in C/C++.
- Kamq 3y ago> C/C++ (the standard) makes no claims about what happens if you overflow integers. It makes no claims on what happens when you overflow signed integers. Unsigned integer wrapping is specified by section 6.2.5, paragraph 9 of the C standard.