错误:
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_open':
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:54: error: dereferencing pointer to incomplete type
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:54: error: dereferencing pointer to incomplete type
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_release':
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:96: error: dereferencing pointer to incomplete type
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:96: error: dereferencing pointer to incomplete type
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_read':
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:140: error: dereferencing pointer to incomplete type
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:140: error: dereferencing pointer to incomplete type
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c: In function 'scumm_write':
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:210: error: dereferencing pointer to incomplete type
- /home/lingd/arm2410s/ldd3/chapter4/scumm/scumm.c:210: error: dereferencing pointer to incomplete type
出错语句:
- printk(KERN_DEBUG "\"%s(pid %d)\" open scumm device!\n", current->comm, current->pid);
宏current定义在arch/arm/include/asm/current.h中,
- static inline struct task_struct *get_current(void)
- {
- return current_thread_info()->task;
- }
- #define current (get_current())
出错原因:
编译器不知道task_struct的具体定义,因此,无法解引用current,无法获知其成员comm、pid的类型,才报“dereferencing pointer to incomplete type”
task_struct定义在中。在源文件头,加上#include ,即可解决问题!
“dereferencing pointer to incomplete type”错误,大多也是因为不知道struct/class/emun/union等的定义而引起的
阅读(18607) | 评论(0) | 转发(0) |