...
| Code Block | ||||
|---|---|---|---|---|
| ||||
const int **ipp;
int *ip;
const int i = 42;
void func(void) {
ipp = &ip; /* Constraint violation */
*ipp = &i; /* Valid */
*ip = 0; /* Valid Modifies constant i (was 42) */
} |
The first assignment is unsafe because it would allow allows the valid code that follows it to attempt to change the value of the const object i.
...