我使用开源代码来构建我的项目。当我添加EGOTextView
到项目中,它具有像语义问题:使用Xcode警告不同符号的整数比较
Comparison of integers of different signs: 'int' and 'NSUInteger' (aka 'unsigned long')
Comparison of integers of different signs: 'NSInteger' (aka 'long') and 'NSUInteger' (aka 'unsigned long')
例如,在源代码:
for (int i = 0; i < lines.count; i++)//lines is an array
我注意到,该项目已建立配置文件,其中包括:
// Make CG and NS geometry types be the same. Mostly doesn't matter on iPhone, but this also makes NSInteger types be defined based on 'long' consistently, which avoids conflicting warnings from clang + llvm 2.7 about printf format checking OTHER_CFLAGS = $(value) -DNS_BUILD_32_LIKE_64
根据评论,我想这会导致问题。 但是,我不知道这个OTHER_CFLAGS
设置的含义。而且我也不知道如何解决它,以避免语义问题。
任何人都可以帮助我吗?
谢谢!
谢谢,它的作品! – scorpiozj
而不是关闭警告,如何修复错误?请参阅下面的[我的回答](http://stackoverflow.com/a/20543204/172218)。 –
如果生成警告的文件来自外部库,请改用文件上的-w'标志。它会使文件中的警告无效,但不会影响项目的其余部分。 –