我有这行:
char* data = (char *) mmap(NULL, size, PROT_READ, MAP_SHARED, fd, offset);
...
size_t lineLength = strlen(data);
char *out = calloc(lineLength, sizeof(data));
在最后一行,我使用新的 XCode 得到以下警告
Result of 'calloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'char *'
我有点卡住了这是一个真正的抱怨吗?