[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Google
  Web www.spinics.net

[PATCH 2 of 5] Improved ansi C compatibility



Hi,

 This patch aims to improve ansi C compatibility. That is, on the issues
addressed by this patch, bcc does not flag any error, but any ansi C
compiler will produce an error and will terminate compilation.

 If we ever want to use ELKS with other processors, will likely need to
use an ansi C compiler.

 The errors corrected with this patch were found attempting to build ELKS
using gcc (instead of bcc). This patch fixes numerous straigthforward
errors.

 The Image builded without errors. The kernel was tested with QEMU and
dioscuri emulators. Also in a PPro pc booting from floppy.

Greetings,

Juan

diff -Nurb elks.orig/include/linuxmt/fs.h elks/include/linuxmt/fs.h
--- elks.orig/include/linuxmt/fs.h      2002-05-30 12:26:11.000000000 -0500
+++ elks/include/linuxmt/fs.h   2011-12-13 10:28:47.000000000 -0600
@@ -401,7 +401,7 @@

 extern int register_chrdev(unsigned int,char *,struct file_operations *);
 extern int unregister_chrdev(void);
-extern int chrdev_open(struct inode *,struct file *);
+/* extern int chrdev_open(struct inode *,struct file *); */

 extern struct file_operations def_chr_fops;
 extern struct inode_operations chrdev_inode_operations;
diff -Nurb elks.orig/include/linuxmt/init.h elks/include/linuxmt/init.h
--- elks.orig/include/linuxmt/init.h    2002-06-04 12:25:17.000000000 -0500
+++ elks/include/linuxmt/init.h 2011-12-13 18:54:00.000000000 -0600
@@ -5,6 +5,9 @@

 #include <linuxmt/types.h>

+struct task_struct;
+struct gendisk;
+
 extern int directhd_init(void);
 extern int rs_init(void);

diff -Nurb elks.orig/include/linuxmt/locks.h elks/include/linuxmt/locks.h
--- elks.orig/include/linuxmt/locks.h   2002-04-26 18:05:27.000000000 -0500
+++ elks/include/linuxmt/locks.h        2011-12-13 10:21:13.000000000 -0600
@@ -7,6 +7,6 @@

 extern void wait_on_super(register struct super_block *);
 extern void lock_super(register struct super_block *);
-extern void unlock_super(register struct super_blocak *);
+extern void unlock_super(register struct super_block *);

 #endif
diff -Nurb elks.orig/include/linuxmt/timer.h elks/include/linuxmt/timer.h
--- elks.orig/include/linuxmt/timer.h   2002-04-26 18:05:27.000000000 -0500
+++ elks/include/linuxmt/timer.h        2011-12-13 18:30:31.000000000 -0600
@@ -84,6 +84,7 @@
     void (*tl_function) ();
 };

+struct pt_regs;
 extern void init_timer(struct timer_list *);
 extern void add_timer(struct timer_list *);
 extern int del_timer(struct timer_list *);
diff -Nurb elks.orig/kernel/sched.c elks/kernel/sched.c
--- elks.orig/kernel/sched.c    2003-01-02 16:45:44.000000000 -0600
+++ elks/kernel/sched.c 2011-12-13 18:34:31.000000000 -0600
@@ -172,7 +172,7 @@
            lastirq, currentp->pid, prev->pid);
 }

-struct timer_list tl_list = { NULL, NULL, NULL, NULL, NULL };
+struct timer_list tl_list = { NULL, NULL, 0L, 0, NULL };

 static int detach_timer(struct timer_list *timer)
 {
diff -Nurb elks.orig/kernel/sys.c elks/kernel/sys.c
--- elks.orig/kernel/sys.c	2002-07-16 12:51:06.000000000 -0500
+++ elks/kernel/sys.c	2012-01-17 18:58:09.000000000 -0600
@@ -95,7 +95,7 @@
 {
     register char *p = system_utsname.release;

-    verified_memcpy_tofs(vsn, p, strlen(p) + 1);
+    return verified_memcpy_tofs(vsn, p, strlen(p) + 1);
 }

 #endif
diff -Nurb elks.orig/include/arch/keyboard.h elks/include/arch/keyboard.h
--- elks.orig/include/arch/keyboard.h	2002-06-04 12:25:16.000000000 -0500
+++ elks/include/arch/keyboard.h	2012-01-21 11:16:23.000000000 -0600
@@ -1,6 +1,7 @@
 #ifndef LX86_ARCH_KEYBOARD_H
 #define LX86_ARCH_KEYBOARD_H

+struct pt_regs;
 extern void keyboard_irq(int,struct pt_regs *,void *);
 extern void Console_set_vc(unsigned);

diff -Nurb elks.orig/include/arch/segment.h elks/include/arch/segment.h
--- elks.orig/include/arch/segment.h	2002-05-30 12:26:11.000000000 -0500
+++ elks/include/arch/segment.h	2012-01-20 16:27:06.000000000 -0600
@@ -20,7 +20,7 @@

 #endif

-extern __u16 setupw(unsigned short int, unsigned short int *);
+extern __u16 setupw(/*unsigned short int, */unsigned short int *);

 extern pid_t get_pid(void);

diff -Nurb elks.orig/include/linuxmt/minix_fs.h elks/include/linuxmt/minix_fs.h
--- elks.orig/include/linuxmt/minix_fs.h	2002-05-29 17:30:05.000000000 -0500
+++ elks/include/linuxmt/minix_fs.h	2012-01-20 15:55:21.000000000 -0600
@@ -89,7 +89,7 @@
 extern struct inode *minix_new_inode(struct inode *);
 extern void minix_put_inode(register struct inode *);
 extern void minix_put_super(register struct super_block *);
-extern void minix_read_inode(register struct inode *);
+/*extern void minix_read_inode(register struct inode *);*/
 extern struct super_block *minix_read_super(register struct super_block *,
 					    char *,int);
 extern int minix_remount(register struct super_block *,int *,char *);
--
To unsubscribe from this list: send the line "unsubscribe linux-8086" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Kernel]     [Linux ia64]     [DCCP]     [Linux for ARM]     [Linux]     [Photo]     [Yosemite News]     [MIPS Architecture]     [Linux SCSI]     [Linux Hams]

Add to Google Powered by Linux