我认为以下代码应使用VS'2013 C编译器进行编译,但在if
不带括号(1行if
...)后无法正常工作的标识符定义中
不起作用,出现以下错误:
1>..\..\common\threadpool.c(82): error C2275: 'test_t' : illegal use of this type as an expression
1> ..\..\common\threadpool.c(75) : see declaration of 'test_t'
1>..\..\common\threadpool.c(82): error C2065: 'pool' : undeclared identifier
typedef struct { int j; } test_t;
int f(test_t **p_pool, int i)
{
if (i <= 0)
return -1;
test_t *pool;
*p_pool = pool;
return i;
}
作品
typedef struct { int j; } test_t;
int f(test_t **p_pool, int i)
{
if (i <= 0) {
return -1;
}
test_t *pool;
*p_pool = pool;
return i;
}
您是否有变通方案以建立庞大的旧代码库,使此类代码可以大量出现?
该代码是有效的,应该编译。这并不表示这是一个编译器错误。您应该向Microsoft提交错误报告。
要解决此问题,您需要执行以下操作之一:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句