提交 8a7eb80e 创建 作者: rsc's avatar rsc

fix main return type

上级 b75c11b2
...@@ -48,7 +48,7 @@ kernel : $(OBJS) bootother.S user1 usertests userfs ...@@ -48,7 +48,7 @@ kernel : $(OBJS) bootother.S user1 usertests userfs
$(LD) -N -e start -Ttext 0x7000 -o bootother.out bootother.o $(LD) -N -e start -Ttext 0x7000 -o bootother.out bootother.o
$(OBJCOPY) -S -O binary bootother.out bootother $(OBJCOPY) -S -O binary bootother.out bootother
$(OBJDUMP) -S bootother.o > bootother.asm $(OBJDUMP) -S bootother.o > bootother.asm
$(LD) -Ttext 0x100000 -e main -o kernel $(OBJS) -b binary bootother user1 usertests userfs $(LD) -Ttext 0x100000 -e main0 -o kernel $(OBJS) -b binary bootother user1 usertests userfs
$(OBJDUMP) -S kernel > kernel.asm $(OBJDUMP) -S kernel > kernel.asm
vectors.S : vectors.pl vectors.S : vectors.pl
......
...@@ -18,8 +18,11 @@ extern uint8_t _binary_userfs_start[], _binary_userfs_size[]; ...@@ -18,8 +18,11 @@ extern uint8_t _binary_userfs_start[], _binary_userfs_size[];
extern int use_console_lock; extern int use_console_lock;
// CPU 0 starts running C code here. // CPU 0 starts running C code here.
int // This is called main0 not main so that it can have
main() // a void return type. Gcc can't handle functions named
// main that don't return int. Really.
void
main0(void)
{ {
int i; int i;
struct proc *p; struct proc *p;
...@@ -89,7 +92,7 @@ main() ...@@ -89,7 +92,7 @@ main()
} }
// Additional processors start here. // Additional processors start here.
int void
mpmain(void) mpmain(void)
{ {
cprintf("an application processor\n"); cprintf("an application processor\n");
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论