不能将 “void *” 类型的值分配到 “task_struct *” 类型的实体 unrunnableTask = malloc(sizeof(struct task_struct)); 添加(struct task_struct*) 即可 unrunnableTask = (struct task_struct*)malloc(sizeof(struct task_struct));