I've pushed fixes for the PetscBool and PetscEnum instances. Please use MPIU_BOOL and MPIU_ENUM in new code. The Complex cases still produce warnings. Let me know if you object to my ripping out those special cases.
https://bitbucket.org/petsc/petsc-dev/commits/659ebb827654e17cd01d6fb5cf1a54155f4e77a7 On Sun, Dec 30, 2012 at 10:48 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote: > I just fixed a bunch of dangerous type mismatches. Presumably a number of > things were broken with 64-bit integers, at least in cases with overflow. > > > https://bitbucket.org/petsc/petsc-dev/commits/146d1df88e306d69e6ce797932b1c3352fd7851c > > These were warnings with clang-3.2. A year ago when people were working on > this feature, I downplayed its importance, claiming that it's just not a > mistake that I tend to make. Based on the sheer number of these mistakes in > PETSc, I now believe it's a fantastic feature. > > There are still a lot of warnings, though I believe the remaining ones are > benign. (The most common is sending PetscBool as MPI_INT.) Since people > will use clang-3.2 and we want to see the real mistakes, we have to silence > these benign warnings. I'm working through annotation of these. > > Another problem case is using a Real reduction of twice the size to sum > Complex, e.g., in vscat.c. I suspect this code predates definition of > MPIU_SUM working with complex, and can thus be removed. Is that the case, > or is there some reason we need to keep both around? > > #if defined(PETSC_USE_COMPLEX) > ierr = > MPI_Reduce(xv,xvt,2*xx_n,MPIU_REAL,MPIU_SUM,0,((PetscObject)ctx)->comm);CHKERRQ(ierr); > #else > ierr = > MPI_Reduce(xv,xvt,xx_n,MPIU_SCALAR,MPI_SUM,0,((PetscObject)ctx)->comm);CHKERRQ(ierr); > #endif > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20121230/10dcb7e7/attachment.html>
