• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Static Analyzer is confusing me
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Conditionally adding NSButtonCell to a column of NSTableview and allowing button cell to take action even if the corresponding row is not allowed to be selected
  • Next by Date: Re: Conditionally adding NSButtonCell to a column of NSTableview and allowing button cell to take action even if the corresponding row is not allowed to be selected
  • Previous by thread: Re: Conditionally adding NSButtonCell to a column of NSTableview and allowing button cell to take action even if the corresponding row is not allowed to be selected
  • Index(es):
    • Date
    • Thread