avoiding incorrect code

Matthew Knepley knepley at gmail.com
Wed Jan 14 15:37:16 CST 2009


On Wed, Jan 14, 2009 at 3:15 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>   From the PETSc developers guide
>
>  Do not use {\em if (rank == 0)} or {\em if (v == PETSC\_NULL)} or {\em if
> (flg == PETSC\_TRUE)} or {\em if (flg == PETSC\_FALSE)}
> instead use {\em if (!rank)} or {\em if (!v)} or {\em if (flg)} or {\em if
> (!flg)}.
>
>  There was a flag == PETSC_TRUE in PETSc 3.0.0 that wasted a lot of several
> peoples time finding it. Come on folks, we have better things to do with our
> time. Please avoid this incorrect usage.


I am fine with 1 and 3. 4 should not matter, but I am somewhat worried about
2. I thought there was no guarantee that
NULL was actually 0, so I always check NULL.

  Matt


>
>   Barry
>
-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20090114/10019824/attachment.html>


More information about the petsc-dev mailing list