我收到了这个编译器警告:
Ordered comparison of function pointers ('IMP' (aka 'id(*)(id,SEL,...)')and "IMP")
当我尝试比较两个实体时:
for (i = 0; k < 30; k++) {
IMP imp = getValue(class_method[i]);
if (imp <= (IMP)currDesc->address) {//this is the line causing the warning
size_t diff = (size_t)classMap->address - (size_t)imp;
if (diff < mediumSize) {
best_method = class_method[i];
is_class_method = YES;
mediumSize = diff;
}
}
你能否解释一下这个警告的最终原因以及如何解决它。