[lkml]   [1996]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subjectexterns in .c files


include/linux/pci.h declares pci_init as:

extern unsigned long pci_init (unsigned long mem_start, unsigned long mem_end);

while in init/main.c it's declared as:

extern long pci_init(long, long);

In this case the mistake is trivial and shouldn't effect the operation of
the kernel, but there's scope for introducing subtle bugs in this
way---e.g., a function `int foo (char *)' being declared `extern int foo
(const char *)' elsewhere.

The quick fix in this case is the patch below. But in the long term,
wouldn't the best thing to do be replace all of those `extern foo()'
declarations in .c files with `#include's of the appropriate .h files?


--- init/main.c~ Sun Nov 24 07:39:41 1996
+++ init/main.c Fri Nov 29 12:24:57 1996
@@ -65,7 +65,7 @@
extern long console_init(long, long);
extern long kmalloc_init(long,long);
extern void sock_init(void);
-extern long pci_init(long, long);
+extern unsigned long pci_init(unsigned long, unsigned long);
extern void sysctl_init(void);

extern void no_scroll(char *str, int *ints);

 \ /
  Last update: 2005-03-22 13:38    [W:0.022 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site