Index: src/OFMutableArray_adjacent.m ================================================================== --- src/OFMutableArray_adjacent.m +++ src/OFMutableArray_adjacent.m @@ -209,15 +209,17 @@ } } - (void)removeObjectAtIndex: (size_t)index { +#ifndef __clang_analyzer__ id object = [self objectAtIndex: index]; [_array removeItemAtIndex: index]; [object release]; _mutations++; +#endif } - (void)removeAllObjects { id *objects = [_array items]; @@ -253,10 +255,11 @@ } } - (void)removeLastObject { +#ifndef __clang_analyzer__ size_t count = [_array count]; id object; if (count == 0) return; @@ -264,10 +267,11 @@ object = [self objectAtIndex: count - 1]; [_array removeLastItem]; [object release]; _mutations++; +#endif } - (void)exchangeObjectAtIndex: (size_t)index1 withObjectAtIndex: (size_t)index2 { Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -419,11 +419,15 @@ */ OF_ROOT_CLASS @interface OFObject { @private +#ifndef __clang_analyzer__ Class _isa; +#else + Class _isa __attribute__((__unused__)); +#endif } /*! * @brief A method which is called once when the class is loaded into the * runtime. Index: src/OFString+JSONValue.m ================================================================== --- src/OFString+JSONValue.m +++ src/OFString+JSONValue.m @@ -650,10 +650,14 @@ void *pool = objc_autoreleasePoolPush(); const char *pointer = [self UTF8String]; const char *stop = pointer + [self UTF8StringLength]; id object; size_t line = 1; + +#ifdef __clang_analyzer__ + assert(pointer != NULL); +#endif object = nextObject(&pointer, stop, &line, depthLimit); skipWhitespacesAndComments(&pointer, stop, &line); if (pointer < stop || object == nil) Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -371,11 +371,11 @@ return [self retain]; } - (OFRunLoop *)runLoop { -# ifdef OF_HAVE_ATOMIC_OPS +# if defined(OF_HAVE_ATOMIC_OPS) && !defined(__clang_analyzer__) if (_runLoop == nil) { OFRunLoop *tmp = [[OFRunLoop alloc] init]; if (!of_atomic_ptr_cmpswap((void **)&_runLoop, nil, tmp)) [tmp release]; Index: tests/OFBlockTests.m ================================================================== --- tests/OFBlockTests.m +++ tests/OFBlockTests.m @@ -95,17 +95,21 @@ TEST(@"Copying a stack block and using its copied variable", (v = returnStackBlock()) && v() == 43 && v() == 44 && v() == 45) TEST(@"Copying a global block", (id)g == [[g copy] autorelease]) +#ifndef __clang_analyzer__ TEST(@"Copying a malloc block", (id)m == [m copy] && [m retainCount] == 2) +#endif TEST(@"Autorelease a stack block", R([s autorelease])) TEST(@"Autorelease a global block", R([g autorelease])) +#ifndef __clang_analyzer__ TEST(@"Autorelease a malloc block", R([m autorelease])) +#endif [pool drain]; } @end Index: tests/OFInvocationTests.m ================================================================== --- tests/OFInvocationTests.m +++ tests/OFInvocationTests.m @@ -14,10 +14,11 @@ * file. */ #include "config.h" +#include #include #ifndef __STDC_NO_COMPLEX__ # include #endif @@ -266,10 +267,14 @@ st.c = 0x55; st.i = 0xAAAAAAAA; TEST(@"+[invocationWithMethodSignature:]", (invocation = [OFInvocation invocationWithMethodSignature: sig])) + +#ifdef __clang_analyzer__ + assert(invocation != nil); +#endif TEST(@"-[setReturnValue]", R([invocation setReturnValue: &st])) TEST(@"-[getReturnValue]", R([invocation getReturnValue: &st2]) && memcmp(&st, &st2, sizeof(st)) == 0)