[petsc-dev] clang --analyze messages on PETSc
Barry Smith
bsmith at mcs.anl.gov
Tue Apr 14 18:00:29 CDT 2015
> On Apr 14, 2015, at 5:40 PM, Jed Brown <jed at jedbrown.org> wrote:
>
> Matthew Knepley <knepley at gmail.com> writes:
>> I really do not want that. I am especially unwilling to do that just to
>> appease static analysis.
>
> I think it's actually better for debuggability and
> strictness/normalization within the code, but we had this argument a
> year ago and if you still insist, I'm not going to dig it up.
But I did. So Matt's argument is that having a pointer you are not allowed to use be anything but NULL is dangerous because it could be used wrong and no one would know.
BTW how come all the code (!(m1) ? (*(r1) = 0,0) : 0) stuff uses 0 instead of NULL? Wouldn't it be clearer to use NULL when one means NULL?
Barry
More information about the petsc-dev
mailing list