I am using linux/list.h to work with lists, but I am having trouble getting started.
I having been experimenting with different combinations based on a few guides' recommendations, but nothing has been working so far. Here's what I believe to be my closest attempt at initialization:
typedef struct {
int to;
struct list_head list;
int from;
} myFrame;
int main() {
LIST_HEAD(listInstance);
myFrame* foo = malloc(sizeof(*foo));
list_add(&foo->list, &listInstance);
}
This produces the warning
initializer element is not computable at load time
at LIST_HEAD()
However, this seems to indicate that I can.
Alternatively, lists can be initialized at compile time
Would someone mind helping me wrap my brain around this?