[petsc-dev] Use of PETSC_DEFAULT in Chaco interface

Barry Smith bsmith at mcs.anl.gov
Sat Feb 2 15:28:25 CST 2013


   Can one just cast the PETSC_DEFAULT in the comparison?

> if (method==(MPChacoEigenType)PETSC_DEFAULT)

or are C compilers too damn smart for their own good now?

   Barry

I'm to lazy to install chaco and try it myself

On Feb 2, 2013, at 3:06 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> /home/jed/petsc/src/mat/partition/impls/chaco/chaco.c:484:13: warning: comparison of constant -2 with expression of type 'MPChacoEigenType' is always false [-Wtautological-c
> onstant-out-of-range-compare]
>   if (method==PETSC_DEFAULT) chaco->eigen_method = MP_CHACO_LANCZOS;
>       ~~~~~~^ ~~~~~~~~~~~~~
> 
> Meanwhile, we have
> 
> typedef enum { MP_CHACO_LANCZOS=0,MP_CHACO_RQI=1 } MPChacoEigenType;
> 
> Either we add a typed MP_CHACO_DEFAULT to the enum or we get rid of the concept of PETSC_DEFAULT in that context. Which is it?




More information about the petsc-dev mailing list