[petsc-dev] Problem with PETSC_NULL and variadic functions

Jed Brown jedbrown at mcs.anl.gov
Thu Nov 10 09:22:56 CST 2011


On Thu, Nov 10, 2011 at 09:18, Dmitry Karpeev <karpeev at mcs.anl.gov> wrote:

> Besides the number of arguments, there is the issue of them being passed
> on the stack, as I (sort of) understand.
> The format string would tell us what type each argument is supposed to be,
> so that the args can be cast correctly inside the called function.  Is that
> right?
>

Passing the correct type is the issue. Passing on the stack vs. register is
an implementation detail that accidentally makes incorrect code work in
some circumstances. With a format string, you could explicitly ignore
entries, so you wouldn't have to bother passing NULL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111110/a5be5963/attachment.html>


More information about the petsc-dev mailing list