[petsc-dev] clang --analyze messages on PETSc

Jed Brown jed at jedbrown.org
Wed Apr 15 12:51:00 CDT 2015


Lisandro Dalcin <dalcinl at gmail.com> writes:
> 2) https://bitbucket.org/petsc/petsc/branch/dalcinl/petscmalloc-1
>
> This one no longer special-cases zero-sized allocations. It fixes all
> the PetscMallocK() macros.
>
> If we ever find a system where system malloc(0) returns NULL, 

Why is this a problem?  I would just accept what malloc(0) returns.

> we can use an obvious approach like in Python sources:
> https://hg.python.org/cpython/file/582e8e71f635/Objects/obmalloc.c#l53

Yuck.  This can hide real off-by-one errors from Valgrind.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20150415/19017350/attachment.sig>


More information about the petsc-dev mailing list