Timeline for If a number is too big does it spill over to the next memory location?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 21, 2016 at 17:16 | comment | added | Matthieu M. | @hobbs: The problem is that when the compilers mangle the program because of Undefined Behavior, actually running the program will indeed produce an unexpected behavior, comparable in effect to overwriting memory. | |
Jan 21, 2016 at 15:42 | comment | added | hobbs | @MatthieuM from a language perspective, that's true. In terms of execution on a given system, which is what we're talking about here, it's absolute nonsense. | |
S Jan 21, 2016 at 13:14 | history | suggested | SuperBiasedMan | CC BY-SA 3.0 |
Including caveat that the OP mentioned in a comment but didn't add.
|
Jan 21, 2016 at 12:23 | review | Suggested edits | |||
S Jan 21, 2016 at 13:14 | |||||
Jan 21, 2016 at 9:34 | history | edited | user53141 | CC BY-SA 3.0 |
added 57 characters in body
|
Jan 21, 2016 at 9:33 | comment | added | user53141 | Sorry, yes, you are correct. I should have added a "usually" in there. | |
Jan 20, 2016 at 15:43 | comment | added | Matthieu M. | If you are working on a system with 4-byte ints, and you set an int variable to 2,147,483,647 and then add 1, the variable will contain -2147483648. => No, it's Undefined Behavior, so it might loop around or it might do something else entirely; I've seen compilers optimizing checks based on the absence of overflow and got infinite loops for example... | |
Jan 20, 2016 at 8:00 | history | answered | user53141 | CC BY-SA 3.0 |