1. petsc
  2. PETSc
  3. petsc

Commits

Tobin Isaac  committed 5455b99

MatSOR_SeqBAIJ: initialize work for pedantic compilers.

The work variable is initialized in a macro within a do{}while(0) construct:
some compilers don't realize that this initialization always happens, so they
complain about uninitialized values. This protects against those warnings.

  • Participants
  • Parent commits 49ea23b
  • Branches master

Comments (0)

Files changed (1)

File src/mat/impls/baij/seq/baij.c

View file
   PetscScalar       *x,*work,*w,*workt,*t;
   const MatScalar   *v,*aa = a->a, *idiag;
   const PetscScalar *b,*xb;
-  PetscScalar       s[7], xw[7];
+  PetscScalar       s[7], xw[7]={0}; /* avoid some compilers thinking xw is uninitialized */
   PetscErrorCode    ierr;
   PetscInt          m = a->mbs,i,i2,nz,bs = A->rmap->bs,bs2 = bs*bs,k,j,idx,it;
   const PetscInt    *diag,*ai = a->i,*aj = a->j,*vi;