If your compiler does not support the restrict
keyword, just take that keyword out (a).
It's used to indicate to the compiler that you (the developer) promise that the pointers follow certain properties involving aliasing, and this, in turn, allows the compiler to perform certain optimisations that would otherwise not necessarily be safe.
If you leave off that keyword in a compiler that supports it, it prevents those optimisations (slight downside).
If you leave it off for compilers that don't support that keyword, the downside is nil (since they don't support those optimisations anyway) and the upside is considerable, as in "it will compile for you" :-)
(a) You may want to ensure you're compiling in C99 mode first. While it may be true that you're using an older gcc
that doesn't understand restrict
, it's equally possible that you're not compiling in C99 mode, such as with -std=c99
(gcc
docs seem to indicate that restrict
has been supported even back to version 3.0).
If, for some reason you cannot activate C99 mode, I think gcc
has an extension that allows you to use __restrict
.