I got two warning and error from the block of code below:
test.c:12:26: warning: ‘struct PrioirtyQueue’ declared inside parameter list [enabled by default]
test.c:12:26: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
test.c: In function ‘set_mask_bit’:
test.c:13:3: error: dereferencing pointer to incomplete type
struct PriorityQueue {
unsigned queue_mask;
int is_empty;
int task_guid;
};
void set_mask_bit(struct PrioirtyQueue *q, unsigned x) {
q->queue_mask = x;
}
int main() {
return 0;
}
Please show me what I need to fix.
struct PrioirtyQueueshould bestruct PriorityQueue(typo).