Linked list

This is a discussion on Linked list within the C Programming forums, part of the General Programming Boards category; Hi guys, I'm a guy learning C, and I have a problems doing something simple like traversing a linked list.
...

The program hangs and nothing is drawn, and I get the following error message: warning: passing arg 1 of `DrawObject' from incompatible pointer type.

The drawobject function is supposed to recieve a parameter or type DrawObject(object_t *object);.
So I assume it's something wrong with the way I try to pass the list elements to it. Any suggestions are appreciated.

Of course you're getting that error. You pass geoList to DrawObject, but geoList is a pointer to list_t, not a pointer to object_t or a void pointer, so the types are incompatible. list_next returns the item, which is of void * type (but actually contains an object_t pointer since that's what you added). You assign that to geoList, which is of type list_t pointer. Then, you call list_size(geoList) on the next iteration of the loop, but geoList no longer points to a valid list_t object, it points to an object_t, so list_size is operating on bogus data. This also trashes geoList, so you can't free it when you're done. You need another pointer to hold the return value from list_next: