Re: Pass-by value… warning
Re: Pass-by value… warning
- Subject: Re: Pass-by value… warning
- From: vincent habchi <email@hidden>
- Date: Wed, 7 Jul 2010 09:23:35 +0200
Le 7 juil. 2010 à 08:54, Greg Guerin a écrit :
> vincent habchi wrote:
>
>> The analyzer does not figure out that the pt array gets initialized through the loop by copying values directly from a chunk of memory, and spits out the warning about pt [•] not being defined. Maybe I should report this to the LLVM team?
>
>
> That seems like a good idea.
>
> However, also consider that 'dim' may take on values 0 or 1. If dim is 0 or 1, then the local 'pt' array may not have valid elements at pt[0] or pt[1]. You may know that dim is never 0 or 1, but the analyzer has no way of knowing that.
>
> And I don't know what might happen if dim is negative.
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.
Vincent
_______________________________________________
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