<div class="gmail_quote">On Fri, Mar 16, 2012 at 15:06, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The code is totally different. I'll fix it.</blockquote></div><br><div>The type (const char ***) is also incorrect for this semantic.</div><div><br></div><div>Unfortunately, C++ forces us to cast to void* just to implement PetscFree() and that discards const. If we could write in C, we could use the implicit conversion to void* without discarding const. </div>
<div><br></div><div>There are workarounds like</div><div><br></div><div>#define PetscCast(type,var) static_cast<type>(var)</div><div><br></div><div>that would not discard the const qualifier.</div>