[petsc-dev] Preprocessor hell: #define VecType

Jed Brown jedbrown at mcs.anl.gov
Fri Sep 28 20:49:46 CDT 2012


On Fri, Sep 28, 2012 at 6:16 PM, Karl Rupp <rupp at mcs.anl.gov> wrote:

>  b) typedef const char* VecType;  imposes usability restrictions and would
> hence break a lot of user-code.


The thing is, the public interface always uses const VecType. The place
this would be most likely to break user code is if they had

const VecType vtype;
...
vtype = "mpi";


I am in favor of an eventual rename of everything, but I always hated the
#define VecType char* business. Our implementation and private functions
that manipulate a type can use raw char* if they need a mutable "VecType".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120928/4f332c78/attachment.html>


More information about the petsc-dev mailing list