Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Program won't crash when it should

Name: Anonymous 2012-01-16 3:24

(GCC C)
I ran a pointer over each member of an integer array, storing one character of input in each cell.

The program seems to consistently crash when I try to store X+3 or more characters, where X is the size of the array, but if I do not exceed X+2 it will not crash.

Why does it crashes exactly at the point it does, but not for X+1 or X+2?

Name: Anonymous 2012-01-16 18:20

>>22
What if the compiler has non-deterministic behavior? What if the compiler has a setting like "optimize for 30 seconds" which depends not only on the compiler but also the speed of the machine, the total amount of load on the system, disk swapping and other non-controllable factors?See:
you can almost always determine them when you have fully specified the environmentHowever, to be fair, determining them by fully understanding the compiler is a bit of a pain, and in some cases it would be literally impossible(let's say you decide to defeat my argument by using a "true random" quantum RNG), the typical way one determines what the behavior is, is by examining the assembly listing generated by the compiler or just disassembling the compiled program - it would be a lot less work than mentally following the same steps a compiler would have to.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List