typeof() and extern
Posted: Mon Feb 06, 2012 10:30 am
Hi everyone!
I'm strugling with the following problem in TCC. I wrote some general linked list functions, like the one below:
Most of the time, this works quite good. But when I try to use this function on a list which is declared as 'extern 'in a header file:
The linker compains about 'undefined reference tmpItem', because
becomes
Is this normal behavior, or a TCC bug? Anyone knows an easy way to make my list generic?
Thanks in advance!
I'm strugling with the following problem in TCC. I wrote some general linked list functions, like the one below:
Code: Select all
#define klibLinkedListPopFront(list) \
({ \
typeof(list) tmpItem = list; \
if(list != NULL) \
{ \
list = tmpItem->next; \
tmpItem->next = NULL; \
} \
tmpItem; \
})
Code: Select all
// In header file:
extern PCB* readyQueue;
// In C file:
klibLinkedListPopFront(readyQueue);
Code: Select all
typeof(list) tmpItem
Code: Select all
extern PCB* tmpItem
Thanks in advance!