Hi,
I'm trying to experiment with the facilities of the queue(3) framework but I'm having a compiling problem I cannot solve:
While I'm able to populate and traverse the list with the foreach (even safe) I cannot remove an element. I cannot see, comparing to the example in the manual, what is the problem.
The compiler provides me the following messages related to the SLIST_REMOVE line:
Any suggestion?
I'm trying to experiment with the facilities of the queue(3) framework but I'm having a compiling problem I cannot solve:
Code:
struct car_st{
char model[ 20 ];
int cc_size;
SLIST_ENTRY(car_st) _cars;
};
...
struct car_st *current = NULL, *previous = NULL;
...
SLIST_FOREACH_SAFE( current, &head, _cars, previous ){
if( current->cc_size % 500 == 1 ){
printf( "\nRemoving the car..." );
SLIST_REMOVE( &head, current, car_st, _cars );
free( current );
}
}
While I'm able to populate and traverse the list with the foreach (even safe) I cannot remove an element. I cannot see, comparing to the example in the manual, what is the problem.
The compiler provides me the following messages related to the SLIST_REMOVE line:
Code:
warning: comparison of distinct pointer types lacks a cast
error: dereferencing pointer to incomplete type
warning: initialization from incompatible pointer type
Any suggestion?