If I got the C99 restrict
keyword right, qualifying a pointer with it is a promise made that the data it references won\'t be modified behind the compiler\'s back t
Someone more familiar with the standard could probably give a better answer, but I'll give it a shot.
"Data won't be modified behind the compiler's back" sounds more like the opposite of "volatile" to me.
"const" means the data won't be modified in front of the programmer; that is, she can't modify the data through the signifier marked as "const" (I write "signifier" because in int const *pi
, the name pi
isn't const, but *pi
is). The data might be modifiable via another signifier (non-const data can be passed to a function as const data, after all).
That "restrict" qualifies pointers is the key. Pointers are the only way to alias data in C, so they're the only way that you can access some piece of data via two different names. "restrict" is all about limiting data access to one access path.