I have a fair amount of string format specifiers in NSLog / NSAssert etc. calls which use %d
and %u
with NSInteger (= int on 32bit)
and NSUInteger (= unsigned int on 32bit)
types respectively.
When converting the app to 64bit, this gives warnings (of course), as %ld %lu
is expected for what now became a long
and unsigned long
type.
Simply converting the format specifiers will of course introduce the reverse warnings in the 32bit build.
So the only solution I see to become warning free is using the 64bit specifiers, and casting to the 64bit value types everywhere a warning is given in the 32bit build.
But I was wondering if perhaps there are format specifiers specifically for the NSInteger
and NSUInteger
type which would work on both architectures without casting?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…