3 ms·
I don't know whether to laugh or cry at some of these anecdotes. As a final example, a buffer overflow checker flagged a bunch of errors of the form unsigne
by camccann 17y ago
I don't know whether to laugh or cry at some of these anecdotes.
As a final example, a buffer overflow checker flagged a bunch of errors of the form
unsigned p[4];
...
p[4] = 1;
"No, ANSI lets you write 1 past the end of the array."
After heated argument, the programmer said, "We'll have to agree to disagree." We could agree about the disagreement, though we couldn't quite comprehend it.
- abecedarius 17y agoHa! That probably came out of a rule in the standard that a pointer may point one past the end of an array. (Bump it any further and your compiler is not required to do anything sensible, iirc.)