Re: Pass-by value… warning
Re: Pass-by value… warning
- Subject: Re: Pass-by value… warning
- From: Ken Thomases <email@hidden>
- Date: Wed, 7 Jul 2010 18:58:17 -0500
On Jul 7, 2010, at 10:27 AM, Greg Guerin wrote:
> vincent habchi wrote:
>
>> That's true, the compiler cannot guarantee that dim > 1, which is always the case actually.
>> I am going to put an extra text at the beginning of the method, like: "if (dim < 1) return;" and see what happens.
>
> If you need to guarantee dim > 1, then your if statement should be:
> if (dim <= 1) return
Also, you can use an assertion, even a custom assertion <http://clang-analyzer.llvm.org/annotations.html#custom_assertions>, and the analyzer will recognize it as truncating that particular code path.
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden