Pointer Restrict

What is the purpose of the restrict modifier on pointers in c? Is the Msafeptr command also a way of accomlishing this?

THS 1138

The restriction is to allow optimizations that would not work if the arrays
that are ‘pointed to’ overlap.

In fortran, it is a rule that if you compile a routine like

subroutine foo(a,b,n)
real*4 a(n), b(n)

you cannot call
foo(c,c,n)
and expect it to work properly, using the same array twice,
or
foo(c, c(10), n)

cannot be guaranteed to work.

We add the C99 restrict attribute to allow us to use more
optimization techniques, because we know that the arrays sent
as arguments will never overlap.

-Msafeptr
in C tells the compiler there are no overlapping pointers, and so
we can optimize more.

dave