[petsc-dev] Problem with PETSC_NULL and variadic functions

Jed Brown jedbrown at mcs.anl.gov
Wed Nov 9 14:46:29 CST 2011


On Wed, Nov 9, 2011 at 14:35, Dmitry Karpeev <karpeev at mcs.anl.gov> wrote:

> Is the problem that we might be using more registers than might be
> necessary in a variadic function call?


The problem is that it's:

1. not portable, we can't assume that ints are passed in pointer registers
with the extra bits zeroed

2. will break on common platforms if we have many arguments. We already
have examples that likely break on 64-bit Windows because my docs say that
only 4 integer parameters are passed in registers. On Linux, 6 integer
parameters are passed in registers, so we should be able to break it by
adding one more component to src/dm/examples/tests/ex16.c and passing
PETSC_NULL as the last argument to DMCompositeScatter (for example).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111109/6fe78959/attachment.html>


More information about the petsc-dev mailing list