• 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
Re: No 'return' statement is not flagged
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No 'return' statement is not flagged


  • Subject: Re: No 'return' statement is not flagged
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 18 Sep 2009 16:05:59 -0400
  • Organization: Rogue Research Inc.

On 9/18/09 2:03 PM, Randall Meadows said:

>I switched my project over to use the Clang LLVM 1.0 compiler
>yesterday; today I wrote a new method, but forgot to include the
>return statement (and the method is declared as return an object).
>
>+ (Collection *)collectionWithContentsOfFile:(NSString *)path
>{
>   NSString *collectionName = [[path lastPathComponent]
>stringByDeletingPathExtension];
>   Collection *collection = [[Collection alloc]
>initWithName:collectionName];
>   collection.storage = [NSDictionary
>dictionaryWithContentsOfFile:path];
>}
>
>But I get no warnings when I compile this.  I do with GCC 4.2, which
>helpfully informs me "warning: control reaches end of non-void
>function".  It's not specific to class methods, also happens with
>instance methods.
>
>I looked for a compiler setting that might control this, but found
>nothing; did I miss it, or is this a LLVM bug?

It's a bug and was discussed on this list just recently.  (Always good
to search archives before posting.)

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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

References: 
 >No 'return' statement is not flagged (From: Randall Meadows <email@hidden>)

  • Prev by Date: No 'return' statement is not flagged
  • Next by Date: Using libcrypto & the 10.6 SDK with a minimum OS requirement of 10.5
  • Previous by thread: No 'return' statement is not flagged
  • Next by thread: Using libcrypto & the 10.6 SDK with a minimum OS requirement of 10.5
  • Index(es):
    • Date
    • Thread