Message294362
Documentation says PyList_SET_ITEM is void, but it lies. The macro is such that it yields the actual element being set.
wrapping the macro content in a do {} while (0) makes sure PyList_SET_ITEM is really void, e.g.:
#define PyList_SET_ITEM(op, i, v) do { (((PyListObject *)(op))->ob_item[i] = (v)); } while (0)
I just ran into the problem while compiling py-qt4 with clang.
There was some confusion between PyList_SET_ITEM and PyList_SetItem:
if (obj == NULL || PyList_SET_ITEM (l, i, obj) < 0)
g++ didn't catch it (because it doesn't see negative pointers as a problem), but clang++ instantly broke.
With PyList_SET_ITEM truly void the problem disappears. |
|
Date |
User |
Action |
Args |
2017-05-24 15:14:12 | espie | set | recipients:
+ espie |
2017-05-24 15:14:12 | espie | set | messageid: <1495638852.56.0.0790136948712.issue30459@psf.upfronthosting.co.za> |
2017-05-24 15:14:12 | espie | link | issue30459 messages |
2017-05-24 15:14:12 | espie | create | |
|