Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 涉及restrict关键字的编译器错误_C++_Restrict_Restrict Qualifier - Fatal编程技术网

C++ 涉及restrict关键字的编译器错误

C++ 涉及restrict关键字的编译器错误,c++,restrict,restrict-qualifier,C++,Restrict,Restrict Qualifier,可能重复: 我正在尝试在OS X 10.8.2上安装,但遇到了很多类似这样的错误: bspline_base.h:95:17: error: expected ';' at end of declaration list void *restrict coefs; ^ ; 我不熟悉restrict关键字,但我觉得这可能是其他类型的问题,因为这是一个为其他人编译的流行代码 以下是该代码的完整上下文: typedef struct {

可能重复:

我正在尝试在OS X 10.8.2上安装,但遇到了很多类似这样的错误:

bspline_base.h:95:17: error: expected ';' at end of declaration list
void *restrict coefs;
              ^
              ;
我不熟悉restrict关键字,但我觉得这可能是其他类型的问题,因为这是一个为其他人编译的流行代码

以下是该代码的完整上下文:

typedef struct
{
  spline_code sp_code;
  type_code   t_code;
  void *restrict coefs;
} Bspline;

<>代码>限制<代码>不是标准C++中的关键字。代码将仅在支持
restrict
扩展名的编译器中编译


restrict
是C99中的一个关键字。因此,如果您使用C99编译器,它可以正常工作。

restrict
仅在C模式下可用
clang++
将需要
\u restrict
-将
-Drestrict=\u restrict
添加到编译器标志中。

关于限制,请参阅。它不是C++语言的关键字(你加标签),正如第一个答案指出的。