这段代码有一个指针int比较,我希望将其作为错误捕获:
NSDecimalNumber *number = [NSDecimalNumber zero];
BOOL test = (number > 0); //should have a warning
我发现的唯一标志就是非常广泛-Wpedantic
error: ordered comparison between pointer and zero ('NSDecimalNumber *' and 'int') is an extension [-Werror,-Wpedantic]
BOOL test = (number > 0);
~~~~~~ ^ ~
是否有更具体的警告标志来将此操作捕获为错误/警告?