gl_list_iterator_next has to return two things: An element (represented by a const void *) and a boolean value. As elements may be NULL, the boolean value is really needed. Of course, one could switch the actual return parameter with the one returned through a pointer but then it wouldn't look as nice in while or for-loops.
So to make my original code portable C, I would have to code
...
const void *e;
while (gl_list_iterator_next (&i, &e, NULL))
{
struct foo *foo = (void *) e;
++foo->bar;
}
...
The const typecast is, unfortunately, still needed to silence compiler warnings as the Gnulib list API suffers a bit from const-poisoning when the actual elements are pointers actually non-const objects.
Marc