[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getting rid of some compilation warnings
From: |
Sebastian Reitenbach |
Subject: |
getting rid of some compilation warnings |
Date: |
Sun, 14 Feb 2010 18:06:33 +0100 |
User-agent: |
Thunderbird 2.0.0.22 (X11/20090701) |
Hi,
I try to cleanup sope/ogo gsmake2 branch, also to get rid of compilation
warnings.
one of them is:
NGImap4ResponseNormalizer.m:686: warning: multiple declarations for
method `hasPrefix:'
/usr/local/include/Foundation/NSString.h:340: warning: using
`-(BOOL)hasPrefix:(NSString *)aString'
../../sope-core/NGExtensions/NGExtensions/NSData+misc.h:29: warning:
also found `-(BOOL)hasPrefix:(NSData *)_data'
The header file NSData+misc.h looks like this:
#import <Foundation/NSData.h>
@interface NSData(misc)
- (BOOL)hasPrefix:(NSData *)_data;
- (BOOL)hasPrefixBytes:(const void *)_bytes length:(unsigned)_len;
@end
the code where the warning is emitted looks like this:
static inline NSArray *
_imapFlags2Flags(NGImap4ResponseNormalizer *self, NSArray *_flags)
{
id obj;
...
while ((obj = [enumerator nextObject])) {
if ([obj isNotEmpty]) {
if ([obj hasPrefix:@"\\"])
objs[cnt] = [obj substringFromIndex:1];
else
objs[cnt] = obj;
cnt++;
}
}
...
}
my guess is that obj is id, and the compiler doesn't know, which one to use.
Is there a way to get rid of the warning?
cheers,
Sebastian
- getting rid of some compilation warnings,
Sebastian Reitenbach <=