...
By using the invalid()
function defined above, the function is less likely to modify memory outside its bounds (see ERR06MSC11-A. Understand the termination behavior of assert() and abort()Incorporate diagnostic tests using assertions).
Code Block | ||
---|---|---|
| ||
void incr(int *intptr) { if (invalid( intptr)) { /* handle error */ } *intptr++; } |
...