<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jul 14, 2011, at 12:16 PM, Kaelyn Uhrain wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">For clarification, which part of the restrictions I mentioned do you see as an ommision in the logic that need to be mentioned in comments with the patch to indicate they are intentional--given that Sema::CheckArrayAccess explicitly only works with an Expr of ConstantArrayType and a second Expr that must return true for isIntegerConstantExpr otherwise CheckArrayAccess doesn't have the two values it needs to perform the check, and given there is already a comment explaining the slight difference in acceptable values depending on whether the index value is an array subscript or a pointer-arithmetic offset?</span></blockquote></div><br><div>I was thinking more of documenting design decisions. For example, documenting in the logic why "array + length" is okay and why "array + length + 1" is not. But you've already done this; so I think you're right that nothing more really needs to be done on that part. Thanks for your patience; I was gradually thinking it through.</div><div><br></div><div>The only other issue: should this be controlled under a separate warning flag, at least initially so we can experiment with this new warning and see how noisy it is? E.g. "-Warray-bounds-pointer-arithmetic".</div></body></html>