If we have a function:
void func(int *restrict a, int *restrict b, int *restrict c) {
*c = *a + *b;
}
In principle, this code may lead to some error:
int aa = 1;
func(&aa, &aa, &aa);
because in func
, *a
*b
*c
will be the same object. But why this code can be compiled successfully?