[petsc-users] Compiler Warning

Barry Smith bsmith at mcs.anl.gov
Wed Nov 3 10:54:22 CDT 2010


On Nov 3, 2010, at 8:57 AM, Jed Brown wrote:

> On Wed, Nov 3, 2010 at 08:09, Barry Smith <bsmith at mcs.anl.gov> wrote:
>> Are you sure this is not a compiler bug. It seems to me the code is ok, what am I missing?
> 
> The optimized piece starts with *(r2)=0, but this is sto->count before
> sto has been initialized.
> 
> Jed

  Right, this is very bad. We set the r2 and r3 up front so the compiler won't complain about possible not set values?

  I guess we need to not use PetscMallocN() for structs and values in the structs.

    Barry




More information about the petsc-users mailing list