[issue45325] Allow "p" in Py_BuildValue
Pablo Galindo Salgado
report at bugs.python.org
Wed Sep 29 16:48:05 EDT 2021
Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:
The va_start macro just sets up a pointer to the first function parameter, e.g.:-
void func (int a, ...)
{
// va_start
char *p = (char *) &a + sizeof a;
}
which makes p point to the second parameter. The va_arg macro does this:-
void func (int a, ...)
{
// va_start
char *p = (char *) &a + sizeof a;
// va_arg
int i1 = *((int *)p);
p += sizeof (int);
// va_arg
int i2 = *((int *)p);
p += sizeof (int);
// va_arg
long i2 = *((long *)p);
p += sizeof (long);
}
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45325>
_______________________________________
More information about the Python-bugs-list
mailing list