<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 7:29 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>> I have removed the use of PETSC_NULL from all PETSc C code. Please remember to just use NULL in PETSc source code in the future (or Karl's script will find you).<br>


><br>
> I see you changed to<br>
><br>
> #define PETSC_IGNORE NULL<br>
><br>
> but kept<br>
><br>
> #define PETSC_NULL 0<br>
><br>
> Should the second be updated to<br>
><br>
> #define PETSC_NULL NULL<br>
><br>
> because it is stricter about passing PETSC_NULL for an integer argument?<br>
<br>
</div>  Yes, I was hesitant to change too much at once. It is fine to change and fine to add the damn deprecated message.</blockquote></div><br>Sadly, this hack does not work because according to C++, the comma-sequence '(x,0)' yields a different type from '0'. In particular, the latter can be implicitly converted to a pointer type, but the former cannot. AFAIK, the only way to do this is to use 'nullptr'. Consequently, we can update to '#define PETSC_NULL NULL', but cannot include a deprecated message. I also think I was perhaps a little overzealous about deprecation. It doesn't cause any hardship for it to exist as long as we don't refer to it any where, thus there may be no reason to break user code by removing PETSC_NULL. Since people are inherently a bit lazy, I think its use will quietly go away.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://bitbucket.org/petsc/petsc-dev/commits/77e0b4525183a96d1d7836ee30256fe1949ca489">https://bitbucket.org/petsc/petsc-dev/commits/77e0b4525183a96d1d7836ee30256fe1949ca489</a><br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra" style>This will cause warnings at those places where PETSC_NULL was used in place of an int, but people should update those anyway because it's confusing.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>Note that we still cannot _depend_ on NULL having "pointer" type, for example, when passed to a variadic function. (We had a thread about that a while back.) It's perfectly valid for stddef.h to '#define NULL 0'.</div>

</div>