Booleans not being set
Booleans not being set
- Subject: Booleans not being set
- From: Erg Consultant <email@hidden>
- Date: Sat, 7 Feb 2009 01:43:04 -0800 (PST)
I have a simple C routine which looks roughly like this:
Boolean IsOnline( char *host, Boolean checkConnection )
{
Boolean result = false;
// 10 other locals here..
// Do some network stuff....
return result;
}
I am using Xcode 2.5. The code works fine on 10.5/10.4 on Intel machines and 10.5 on PowerPC machines. However, when I run this code on 10.4.11/PowerPC, I get all kinds of weird behavior. This routine returns true no matter what I do - even if the network cable is unplugged and there is no net connection. Even when my return code is set to false it still returns true. I step through it in the debugger and result is always set to YES even on the first line.
Futhermore, many of my locals don't show up at all in the debugger or the debugger doesn't execute their assignments on entry to the routine. Some it does, some it skips. The logic in the routine works because I've tested it on all the other machines mentioned and it works perfectly. I have turned off all optimizations and am using the Debug configuration. I've also turned on full symbols.
I'd like to know why this is happening as a routine returning true even when I set the return value to false is not the way code nor a compiler should behave.
Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden