• 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
Analyzer warning about garbage with double return values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Analyzer warning about garbage with double return values


  • Subject: Analyzer warning about garbage with double return values
  • From: Markus Spoettl <email@hidden>
  • Date: Wed, 2 Sep 2009 10:07:54 +0200

Hello,

analyzer is a really really fantastic thing in Xcode 3.2, it's really cool.

What I don't understand with code like this:

- (void)func:(NSString *)val
{
   [...]
   double d = [val doubleValue];
   [...]
}

I get this Logic Error:

- The receiver in the message expression is 'nil' and results in the returned value (of type 'double' and of size 8 bytes) to be garbage or otherwise undefined
1. Assuming pointer value is null
2. The receiver in the message expression is 'nil' and results in the returned value (of type 'double' and of size 8 bytes) to be garbage or otherwise undefined



I thought it was safe to message nil-objects, the return value would be 0 or the equivalent for the respective expression return type. Is this not the case for double return values?


I'm using Xcode 3.2 on 10.6 with the (32bit) project set to use the 10.5 base SDK.

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Analyzer warning about garbage with double return values
      • From: Jonas Maebe <email@hidden>
    • Re: Analyzer warning about garbage with double return values
      • From: Chris Suter <email@hidden>
  • Prev by Date: Re: XCode 3, SCM and SVN
  • Next by Date: Re: Analyzer warning about garbage with double return values
  • Previous by thread: Re: ProfileSystem ADC Example FindDictionaryForDataType EXC_BAD_ACCESS
  • Next by thread: Re: Analyzer warning about garbage with double return values
  • Index(es):
    • Date
    • Thread