LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 956|回复: 2

这算那门子错误?

[复制链接]
发表于 2005-7-26 19:41:51 | 显示全部楼层 |阅读模式
编译时出现了这样的错误,
make CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i386 " -C  kernel
make[1]: Entering directory `/usr/src/linux-2.4.24/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.4.24/kernel'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i386   -nostdinc -iwithprefix include -DKBUILD_BASENAME=sched  -fno-omit-frame-pointer -c -o sched.o sched.c
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/usr/src/linux-2.4.24/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/usr/src/linux-2.4.24/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:409: error: conflicting types for 'schedule_timeout'

打开这个文件看看,第一个错误发生在这里,
    210 static FASTCALL(void reschedule_idle(struct task_struct * p));
    211
    212 static void reschedule_idle(struct task_struct * p)
    213 {
    214 #ifdef CONFIG_SMP
    215   int this_cpu = smp_processor_id();
    216   struct task_struct *tsk, *target_tsk;
    217   int cpu, best_cpu, i, max_prio;
    218   cycles_t oldest_idle;
    219

按来说 这样没有什么问题呀 并没有重复定义,前一次只是声明而已。

我用的是debian下的gcc-3.4编译,大家看这是什么问题?是我的gcc不够新?
发表于 2005-7-27 09:47:11 | 显示全部楼层
Post by smego
编译时出现了这样的错误,
make CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i386 " -C  kernel
make[1]: Entering directory `/usr/src/linux-2.4.24/kernel'
make all_targets
make[2]: Entering directory `/usr/src/linux-2.4.24/kernel'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.24/include -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i386   -nostdinc -iwithprefix include -DKBUILD_BASENAME=sched  -fno-omit-frame-pointer -c -o sched.o sched.c
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:213: error: conflicting types for 'reschedule_idle'
sched.c:210: error: previous declaration of 'reschedule_idle' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/usr/src/linux-2.4.24/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:371: error: conflicting types for 'wake_up_process'
/usr/src/linux-2.4.24/include/linux/sched.h:601: error: previous declaration of 'wake_up_process' was here
sched.c:409: error: conflicting types for 'schedule_timeout'

打开这个文件看看,第一个错误发生在这里,
    210 static FASTCALL(void reschedule_idle(struct task_struct * p));
    211
    212 static void reschedule_idle(struct task_struct * p)
    213 {
    214 #ifdef CONFIG_SMP
    215   int this_cpu = smp_processor_id();
    216   struct task_struct *tsk, *target_tsk;
    217   int cpu, best_cpu, i, max_prio;
    218   cycles_t oldest_idle;
    219

按来说 这样没有什么问题呀 并没有重复定义,前一次只是声明而已。

我用的是debian下的gcc-3.4编译,大家看这是什么问题?是我的gcc不够新?

呵呵,估计是gcc太新了,而不是不够新

另外你的编译参数真多,尝试去掉一些限制看看,比如-Wstrict-prototypes
回复 支持 反对

使用道具 举报

发表于 2005-12-1 12:15:00 | 显示全部楼层
static和FASTCALL中间好像缺void,括号里面的void应该去掉
static void FASTCALL(reschedule_idle(struct task_struct * p));
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表