Variably modified array at file scope

来源:互联网 发布:锻炼身体的软件app 编辑:程序博客网 时间:2024/05/17 23:06


原因是静态数组被声明为动态数组了。

修改方法:将下标值修改为固定常数

例如

#define WRONG_MAX g_ul32test;

static int parray[WRONG_MAX];

这里g_ul32test可能是变量。

修改后,

#define WRONG_MAX 4;

static int parray[WRONG_MAX];



参考

http://blog.csdn.net/wusuopubupt/article/details/18408227

0 0
原创粉丝点击