Strange bug with nested function
Strange bug with nested function
- Subject: Strange bug with nested function
- From: Nathan Day <email@hidden>
- Date: Mon, 9 Jun 2003 00:50:56 +0930
I have this strange bug that occurs with the calling of a nested
function and have track down the problem to where the nested function
is defined, this is what my code looks like with all of the irrelevant
stuff removed
- (void)applyTint . . . // 6 parameter
{
auto NSColor * theTintFunc( NDColorMapTable * aTable, unsigned int
anIndex, NSColor * aColor, void * ignored );
if( . . . )
{
[self setColorsWithFunction:theTintFunc withContext:NULL]; // HERE
}
NSColor * theTintFunc( NDColorMapTable * aTable, unsigned int anIndex,
NSColor * aColor , void * ignored )
{
. . .
if I stop the program in the compiler at the line ending in // HERE,
where I pass the function to another method and then try to print the
value of the function ( p theTintFunc ) I get the message
'No symbol "theTintFunc" in current context.'
when the function is called in the setColorsWithFunction: method I get
this error 'Program received signal: "EXC_BAD_INSTRUCTION"' presumable
because it's a pointer to garbage.
What is even weirder is that I wrote this code in another project and
it worked fine, but now I have imported it into my current project it
now has this problem. I have tried to move the function to the
beginning of the method so I don't have to pre-declare it but it makes
no difference. I have also tried rebuilding everything from scratch but
that makes no difference either. Anybody have any ideas.
Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.