1. petsc
  2. PETSc
  3. petsc

Commits

Jed Brown  committed 82102fc

MatZeroRows_MPIAIJ: cast to PetscInt* because clang attributes don't understand const

Clang provides the attribute pointer_with_type_tag, but even though
the argument is const in our function, the attribute does not
recognize this and thus warns about a mismatch.

Reported-by: Barry Smith <bsmith@mcs.anl.gov>

  • Participants
  • Parent commits 5ba1750
  • Branches master

Comments (0)

Files changed (1)

File src/mat/impls/aij/mpi/mpiaij.c

View file
     ierr = PetscSFCreate(PetscObjectComm((PetscObject) A), &sf);CHKERRQ(ierr);
     ierr = PetscSFSetGraph(sf, n, N, NULL, PETSC_OWN_POINTER, rrows, PETSC_OWN_POINTER);CHKERRQ(ierr);
     /* Collect flags for rows to be zeroed */
-    ierr = PetscSFReduceBegin(sf, MPIU_INT, rows, lrows, MPI_LOR);CHKERRQ(ierr);
-    ierr = PetscSFReduceEnd(sf, MPIU_INT, rows, lrows, MPI_LOR);CHKERRQ(ierr);
+    ierr = PetscSFReduceBegin(sf, MPIU_INT, (PetscInt*)rows, lrows, MPI_LOR);CHKERRQ(ierr);
+    ierr = PetscSFReduceEnd(sf, MPIU_INT, (PetscInt*)rows, lrows, MPI_LOR);CHKERRQ(ierr);
     ierr = PetscSFDestroy(&sf);CHKERRQ(ierr);
     /* Compress and put in row numbers */
     for (r = 0; r < n; ++r) if (lrows[r] >= 0) lrows[len++] = r;