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

No 'return' statement is not flagged


  • Subject: No 'return' statement is not flagged
  • From: Randall Meadows <email@hidden>
  • Date: Fri, 18 Sep 2009 14:03:24 -0600

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?


randy

_______________________________________________
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: No 'return' statement is not flagged
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Re: codesign from a bash script?
  • Next by Date: Re: No 'return' statement is not flagged
  • Previous by thread: Re: how do you view array values
  • Next by thread: Re: No 'return' statement is not flagged
  • Index(es):
    • Date
    • Thread