Author rolland
Recipients belopolsky, christian.heimes, rolland
Date 2008-03-25.21:40:19
SpamBayes Score 0.172214
Marked as misclassified No
Message-id <47E9713F.3090009@ghs.com>
In-reply-to <1206455460.09.0.852988764434.issue2443@psf.upfronthosting.co.za>
Content
This is what I meant. The initialization should be done by calling 
va_start(count_va); as you described.
In the files and lines I reported though, this is not called.
I'll file a patch for it soon.
--Rolland Dudemaine

Alexander Belopolsky wrote:
> Alexander Belopolsky <belopolsky@users.sourceforge.net> added the comment:
>
> This is not a bug.  All the reported functions expect va_list argument
> to be initialized before being called.  AFAICT, they are consistently
> used in this way.  For example,
>
> PyObject *
> PyObject_CallFunctionObjArgs(PyObject *callable, ...)
> {
>         PyObject *args, *tmp;
>         va_list vargs;
>
>         if (callable == NULL)
>                 return null_error();
>
>         /* count the args */
>         va_start(vargs, callable);
>         args = objargs_mktuple(vargs);
>         va_end(vargs);
>         if (args == NULL)
>                 return NULL;
>         tmp = PyObject_Call(callable, args, NULL);
>         Py_DECREF(args);
>
>         return tmp;
> }
>
> This may need to be clarified in the docs.  For example, PyString_FromFormatV does not mention that vargs needs to be
> initialized: <http://docs.python.org/dev/c-
> api/string.html#PyString_FromFormatV>.  On the other hand, this may be
> obvious to most C programmers.
>
> I suggest to close this issue as invalid.
>
> ----------
> nosy: +belopolsky
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue2443>
> __________________________________
>
History
Date User Action Args
2008-03-25 21:40:21rollandsetspambayes_score: 0.172214 -> 0.172214
recipients: + rolland, belopolsky, christian.heimes
2008-03-25 21:40:20rollandlinkissue2443 messages
2008-03-25 21:40:19rollandcreate