I have the following class:

#import "BugTest.h"

#ifdef MAKE_BUG_DISAPPEAR2
static const unsigned int kArraySize = 22;
#else
static unsigned int kArraySize = 22;
#endif

@implementation BugTest

- (void)aBug;
{
        NSUInteger bbb[kArraySize] ;
        
        #ifdef MAKE_BUG_DISAPPEAR1
                for( NSUInteger i = 0; i < MAKE_BUG_DISAPPEAR1; i++ ) bbb[i] = 
0;
        #endif
        
        for( NSUInteger i = 0; i < kArraySize; i++ ) bbb[i] = 0;
        
        for( NSUInteger i = 0; i < kArraySize; i++ ) 
        {
                fprintf(stderr, "a[%lu] = %lu\n", (unsigned long)i, (unsigned 
long)bbb[i]);     //      <--- Pass-by-value argument in function call is 
undefined
        };
}
   
@end

The Static Analyzer says: " Pass-by-value argument in function call is 
undefined", which I just plainly do not understand.

Why does this error message go away when I add:
#define MAKE_BUG_DISAPPEAR1     3

Why does it NOT go away with:
#define MAKE_BUG_DISAPPEAR1     2 // or anything less than 3 ? What is so 
magical about 3?

Why does this error message go away when I add:
#define MAKE_BUG_DISAPPEAR2

Is this correct Objective-C or not?

Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to