If we have for example f and g defined as:
void f(const int *restrict a, const int *restrict b, int *c){ ... }
void g(const int * a, const int * b, int *c){ ... }
- Assumming f and g have equivalent bodies, are they the same from the caller point of view?
- In the callee, can we make the same assumptions on the parameters?
- Has the compiler the same optimization opportunities?
If restrict
is redundant I would expect all three answers to be yes.
Otherwise, why not?
Do not take into account bad programming practices like casting away the const
qualifier.