]> Devi Nivas Git - cs3210-lab1.git/commitdiff
fix main return type
authorrsc <rsc>
Sun, 16 Jul 2006 16:03:51 +0000 (16:03 +0000)
committerrsc <rsc>
Sun, 16 Jul 2006 16:03:51 +0000 (16:03 +0000)
Makefile
main.c

index 1203a3de3f2fb8ad7e2383105314364b5fd4057c..e5145802bb4535d00a34eff6c3ea766d09859b59 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -48,7 +48,7 @@ kernel : $(OBJS) bootother.S user1 usertests userfs
        $(LD) -N -e start -Ttext 0x7000 -o bootother.out bootother.o
        $(OBJCOPY) -S -O binary bootother.out bootother
        $(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
 
 vectors.S : vectors.pl
diff --git a/main.c b/main.c
index 3f2d57ae8cfadb05167a7da381bf8f5ed72d379c..7606adccfb2a2717ff64b77048be683eeace6182 100644 (file)
--- a/main.c
+++ b/main.c
@@ -18,8 +18,11 @@ extern uint8_t _binary_userfs_start[], _binary_userfs_size[];
 extern int use_console_lock;
 
 // CPU 0 starts running C code here.
-int
-main()
+// This is called main0 not main so that it can have
+// a void return type.  Gcc can't handle functions named
+// main that don't return int.  Really.
+void
+main0(void)
 {
   int i;
   struct proc *p;
@@ -89,7 +92,7 @@ main()
 }
 
 // Additional processors start here.
-int 
+void
 mpmain(void)
 {
   cprintf("an application processor\n");