<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">As long as you have a flat address space, this trick works. The problem is (was) for systems with memory segments; in that case, &realarray[-1] might not be valid.<div><br></div><div>Bill</div><div><br><div><div>On Mar 30, 2010, at 12:30 PM, Barry Smith wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div> What do the PETSc developers think of this? Is it "<span class="Apple-style-span" style="font-family: Times; ">otherwise, the behavior is undefined, <em>even if the pointer is not dereferenced</em>."? </span></div><div><font class="Apple-style-span" face="Times"><br></font></div><div><font class="Apple-style-span" face="Times"> Whenever we work with global indices like in FormFunctionLocal() we do this. </font></div><div><font class="Apple-style-span" face="Times"><br></font></div><div><font class="Apple-style-span" face="Times"> Is PETSc wrong to ever do this? Is there any other way to allow users to work with global indices in a simple way? Do we need to strip out all the FormFunctionLocals() from PETSc? Not the end of the world but it provides such a nice simple interface for simple problems it seems a pity to toss it.</font></div><div><font class="Apple-style-span" face="Times"><br></font></div><div><font class="Apple-style-span" face="Times"> Thanks</font></div><div><font class="Apple-style-span" face="Times"><br></font></div><div><font class="Apple-style-span" face="Times"> Barry</font></div><div><font class="Apple-style-span" face="Times"><br></font></div></div></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: 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: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>William Gropp</div><div>Deputy Director for Research</div><div>Institute for Advanced Computing Applications and Technologies</div><div>Paul and Cynthia Saylor Professor of Computer Science</div><div>University of Illinois Urbana-Champaign</div><div><br class="khtml-block-placeholder"></div></div><br class="Apple-interchange-newline"></span></div></span><br class="Apple-interchange-newline"> </div><br></div></body></html>