Re: No 'return' statement is not flagged
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