[pacman-dev] There is a "problem" with list->prev tail pointer

Aaron Griffin aaronmgriffin at gmail.com
Tue Nov 20 16:08:33 EST 2007

On Nov 20, 2007 9:46 AM, Nagy Gabor <ngaba at bibl.u-szeged.hu> wrote:
> Look at the following code-part:
> for(i = list; i; i = i->next) {
>         alpm_list_foo(i); /*WARNING!!*/
> }
> Comment:
> So a node in a list (i in the example) is NOT a valid alpm_list_t:
> You can do alpm_list_getdata for example, but not alpm_list_add.
> This is very confusing to me.
> We should somehow differeniate between alpm_list_t and alpm_list_node_t types,
> so at least force the compiler to give a warning message.

That's only half solving the problem. In reality, our list structure
kinda sucks. We've talked before about replacing it with something
better, and I would much rather see something like that then discuss
the semantics and usage of our current implementation which we all
have already agreed is a little lacking.

More information about the pacman-dev mailing list