• 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
Booleans not being set
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Booleans not being set
      • From: Howard Moon <email@hidden>
    • Re: Booleans not being set
      • From: Steve Checkoway <email@hidden>
    • Re: Booleans not being set
      • From: Jonas Maebe <email@hidden>
  • Prev by Date: Re: Xcode 3.1.2: Svn 1.5 support?
  • Next by Date: Re: Booleans not being set
  • Previous by thread: Re: Unit Testing a Cocoa Bundle
  • Next by thread: Re: Booleans not being set
  • Index(es):
    • Date
    • Thread