【发布时间】:2011-08-07 18:30:03
【问题描述】:
代码是:
Push(size, (POINTER)(GetCar(i) == term_Null()? 0 : 1));
这里是 C code push 返回ABC
typedef POINTER *ABC
typedef void * POINTER
ABC size;
Push(ABC,POINTER);
XYZ GetCar(int);
typedef struct xyz *XYZ;
XYZ term_Null();
long int i;
特定警告的原因是什么?
【问题讨论】:
-
是 sizeof(int)==sizeof(void*) 在你的平台上吗?
-
no int 的大小和 void 指针 ** 的大小不同。所以我使用 **long int.
-
那么您对这条消息有什么不明白的地方?您将 int 转换为指针类型,您知道它们具有不同的大小,并且消息再次告诉您。看起来很清楚,不是吗?
标签: c gcc gcc-warning