0

Possible Duplicate:
What does the restrict keyword mean in C++?

I'm trying to install QMCPACK on OS X 10.8.2 and I'm getting a lot of errors like this:

bspline_base.h:95:17: error: expected ';' at end of declaration list
void *restrict coefs;
              ^
              ;

I am unfamiliar with the restrict keyword but I feel like this may be some other kind of problem, because this is a popular code that compiles for other people.

Here is the full context of that code:

typedef struct
{
  spline_code sp_code;
  type_code   t_code;
  void *restrict coefs;
} Bspline;
Community
  • 1
  • 1
Nick
  • 5,228
  • 9
  • 40
  • 69
  • About restrict, see http://stackoverflow.com/questions/776283/what-does-the-restrict-keyword-mean-in-c. It is not a keyword of the C++ language (which you tagged), as the first answer points out. – Daniel Daranas Jan 13 '13 at 20:15

2 Answers2

2

restrict is not a keyword in standard C++. The code will only compile in a compiler that supports the restrict extension.

restrict is a keyword in C99. So if you use a C99 compiler it would work fine.

K-ballo
  • 80,396
  • 20
  • 159
  • 169
0

restrict is only available in C mode. clang++ will need __restrict - add -Drestrict=__restrict to compiler flags.

zch
  • 14,931
  • 2
  • 41
  • 49