<div class="gmail_quote">On Fri, Jun 3, 2011 at 20:27, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":27u"> Actually aside from the MPI calls it looks like the big problems are:<br>
<br>
#elif defined(PETSC_HAVE_ISINF) && defined(PETSC_HAVE_ISNAN) && !defined(_GLIBCXX_CMATH)<br>
PETSC_STATIC_INLINE PetscErrorCode PetscIsInfOrNanScalar(PetscScalar a) {<br>
  return isinf(PetscAbsScalar(a)) || isnan(PetscAbsScalar(a));<br>
}<br>
<br>
which wants floats, not doubles. I tried casting to float and it didn't help so not sure how to fix.</div></blockquote><div><br></div><div>I don't understand this issue, but it has to do with PetscAbsScalar() operating on undetermined types. I made PetscAbsScalar() an inline function so its argument and return type is specified and this issue goes away.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":27u">   And<br>
<br>
<br>
#if defined(PETSC_HAVE_BUILTIN_EXPECT)<br>
#  define PetscUnlikely(cond)   __builtin_expect(!!(cond),0)<br>
#  define PetscLikely(cond)     __builtin_expect(!!(cond),1)<br>
<br>
which I also didn't know how to fix.</div></blockquote></div><br><div>I didn't see this using gcc-4.6 or clang-2.9. Clang also has -Wshorten-64-to-32 which does exactly what you want.</div><div><br></div><div>I just configured</div>
<div><br></div><div>./configure --with-mpi-dir=~/usr/mpich-clang --with-fortran=0 --with-shared-libraries --with-64-bit-indices --CFLAGS='-Wall -Wextra -Wconversion -Wno-unused-parameter -Wno-sign-conversion'</div>
<div><br></div><div>and almost all the warnings are MPI-related. There are still a lot of warnings, but they are relevant. I like Clang's warnings much more, but GCC warnings should be relevant here too.</div>