1 // Like the compiler, the static analyzer treats some functions differently if
2 // they come from a system header -- for example, it is assumed that system
3 // functions do not arbitrarily free() their parameters, and that some bugs
4 // found in system headers cannot be fixed by the user and should be
6 #pragma clang system_header
8 typedef __typeof(sizeof(int)) size_t;
10 void *calloc(size_t, size_t);
16 #import "system-header-simulator-objc.h"
18 @interface Wrapper
: NSData
19 - (id
)initWithBytesNoCopy
:(void *)bytes length
:(NSUInteger
)len
;
22 @implementation Wrapper
23 - (id
)initWithBytesNoCopy
:(void *)bytes length
:(NSUInteger
)len
{
24 return [self initWithBytesNoCopy
:bytes length
:len freeWhenDone
:1]; // no-warning
28 @interface CustomData
: NSData
29 + (id
)somethingNoCopy
:(char *)bytes
;
30 + (id
)somethingNoCopy
:(void *)bytes length
:(NSUInteger
)length freeWhenDone
:(BOOL
)freeBuffer
;
31 + (id
)something
:(char *)bytes freeWhenDone
:(BOOL
)freeBuffer
;