Warning: cast to/from pointer from/to integer of different size

将int变量转为(void*)时出现错误 error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

这是由于int类型为32位,指针为long long 64位

解决方法:(void*)(intptr_t)

posted @ 2017-10-25 14:47  鸭子船长  阅读(11627)  评论(0编辑  收藏  举报