[petsc-dev] Compliant C89

Jed Brown jedbrown at mcs.anl.gov
Mon Jan 14 13:00:11 CST 2013


On Mon, Jan 14, 2013 at 12:57 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>  Ok, I didn't realize inline functions can't be called in a declaration.
>

In C89, it can't, but most compilers will happily allow it. But if we
changed to an inline function, we would have to change the prototype to
properly return an error, i.e.,

PetscErrorCode PetscBLASIntCast(PetscInt,PetscBLASInt*);

which obviously cannot be called in a declaration. It's syntactically
heavier, but more honest about what really happens.


>
>     If that is the case then I am fine with changing to an inline and thus
> forcing it always out of declarations.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130114/d9292ab1/attachment.html>


More information about the petsc-dev mailing list