...
-Always use strictest alignment type for arbitrary pointers.
Code Block | ||
---|---|---|
| ||
int *loop_ptr; |
...
int * int_ptr; |
...
int *loopFunction(int *v_pointer) { |
...
return v_pointer; |
...
} |
...
int_ptr = loopFunction(loop_ptr); |
...
Code Block | |
---|---|
bgColor | #ccccff
|
Risk Assessment
Accessing a pointer that is no longer on the correct access boundary can cause a program to crash, give wrong information or have slow pointer accesses (if the architecture does not care about alignment).
...