[petsc-dev] macro wrappers around functions to caste suck

Jed Brown jedbrown at mcs.anl.gov
Sun Apr 7 17:13:24 CDT 2013


Barry Smith <bsmith at mcs.anl.gov> writes:

>     Presumably the cast for function pointers IS needed for certain
>     C++ compilers and cannot (or should not?) be done manually by
>     users so we would do the trick for those?

Yeah, that cast to (PetscVoidFunction*) is clumsy and we really want to
interpret the function as untyped.  Some compilers will warn despite the
cast if a user tries to pass something that is not a function pointer,
thus I think the hidden cast is definitely the right thing there.

The PetscObject argument is far from opaque (function pointer or non)
data so I think a cast there is more dubious.



More information about the petsc-dev mailing list