Is there a keyword/compiler option in modern standards of C language which tells the compiler that I promise not to overlap different pointer-variables in memory? Say,
void f(int *x, int *y);
promise that my manipulations with x
will not implicitly affect y
. E.g. x
and y
are arrays and I know their sizes, and I will not screw up the limits, etc.
I suppose that would allow for a better optimization by the compiler.
Yes. Check out the restrict
keyword.
Restrict details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With