我使用開源代碼來構建我的項目。當我添加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'標誌。它會使文件中的警告無效,但不會影響項目的其餘部分。 –