Static Analyzer is confusing me
Static Analyzer is confusing me
- Subject: Static Analyzer is confusing me
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 01 Mar 2011 13:47:41 +0700
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 (email@hidden)
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:
This email sent to email@hidden