[petsc-users] Compiler Warning

Jed Brown jed at 59A2.org
Wed Nov 3 07:33:35 CDT 2010


On Wed, Nov 3, 2010 at 02:39, Andreas Hauffe
<andreas.hauffe at tu-dresden.de>wrote:

> Hi,
>
> during the compilation process I'm getting the following warning. Is this a
> problem?
>
> Warning libfast in: /scratch/ahauffe/petsc-3.1-p5/src/vec/vec/utils
> vscat.c(322): warning #592: variable "sto" is used before its value is set
>    ierr                =
> PetscMalloc2(1,VecScatter_MPI_ToAll,&sto,size,PetscMPIInt,&sto-
> >count);CHKERRQ(ierr);


Thanks for pointing this out, I didn't notice when it was introduced (to fix
a different warning).

http://petsc.cs.iit.edu/petsc/petsc-dev/rev/4ff7b4bc0bea

I'm surprised other compilers haven't warned about this, and that we haven't
seen any bad behavior because of it.

We either need to find a way to tweak the macro to clean up after itself
correctly in the case of malloc failure, without dereferencing something
that may not exist yet (conflicting goals), or fix any calls that try to
build a structure like this with a single malloc.

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101103/cd0b22e5/attachment.htm>


More information about the petsc-users mailing list