[petsc-dev] Preprocessor hell: #define VecType

Jed Brown jedbrown at mcs.anl.gov
Sat Sep 29 21:08:50 CDT 2012


On Sat, Sep 29, 2012 at 12:20 PM, Dmitry Karpeev <karpeev at mcs.anl.gov>wrote:

> > ^^^ Note that this const is superfluous.
>>
> Why is it superfluous?  Isn't the second argument type const char* const
> this way?
>

It's superfluous for the same reason we don't "set" by passing "const
PetscInt". The const is irrelevant to the caller. All it means is that the
implementation doesn't change the *its* copy (pass by value) and even that
isn't type checked with respect to the public declaration. It's just
clutter and suggests that the person who wrote it doesn't understand types.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120929/895fd43f/attachment.html>


More information about the petsc-dev mailing list