Jed,
It seems this PETSC_UINTPTR_T here is allowing one to cast a void * to a
function pointer without generating a warning/error? Is this correct code? Why
does it even work?
I’m trying to get rid of the last of the "casting object pointer to
function pointer" warning messages out of PETSc but still get a truck load with
#define CHKFORTRANNULLFUNCTION(a) \
if (FORTRANNULLSCALAR(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLREAL(a) ||
FORTRANNULLINTEGER(a) || FORTRANNULLOBJECT(a)) { \
PetscError(PETSC_COMM_SELF,__LINE__,"fortran_interface_unknown_file",__FILE__,PETSC_ERR_ARG_WRONG,PETSC_ERROR_INITIAL,
\
"Use PETSC_NULL_FUNCTION"); *ierr = 1; return; } \
else if (FORTRANNULLFUNCTION(a)) { a = NULL; }
because each of the FORTRANNULLXXX() tests cast the function pointer a to an
object pointer. Can I instead use the PETSC_UINTPTR_T trick to cast the object
pointers
like PETSC_NULL_INTEGER_Fortran to function pointers and compare them to
eliminate all the warnings?
Thanks
Barry