Results 1 to 5 of 5
hi all:
i followed the <The Linux Kernel Module Programming Guide>, and wrote a module hello-1.c:
Code:
#include <linux/module.h>
#include <linux/kernel.h>
int init_module&#40;void&#41;
&#123;
printk&#40;"<1>Hello world 1.\n"&#41;;
return 0;
&#125;
...
- 12-14-2005 #1Just Joined!
- Join Date
- Dec 2005
- Posts
- 3
no previous prototype for `init_module'
hi all:
i followed the <The Linux Kernel Module Programming Guide>, and wrote a module hello-1.c:
meanwhile i built a makefile:Code:#include <linux/module.h> #include <linux/kernel.h> int init_module(void) { printk("<1>Hello world 1.\n"); return 0; } void cleanup_module(void) { printk(KERN_ALERT "Goodbye world 1.\n"); }
but, when i executed the make command, i have gotten these:Code:TARGET := hello-1 WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes INCLUDE := -isystem /lib/modules/`uname -r`/build/include CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE} CC := gcc ${TARGET}.o: ${TARGET}.c
what is wrong with it? who would tell me? many thanks!!!Code:hello-1.c:5: warning: no previous prototype for `init_module' hello-1.c:12: warning: no previous prototype for `cleanup_module' /lib/modules/2.4.20-8/build/include/asm/processor.h: In function `copy_segments': /lib/modules/2.4.20-8/build/include/asm/processor.h:456: warning: unused parameter `p' /lib/modules/2.4.20-8/build/include/asm/processor.h:456: warning: unused parameter `mm' /lib/modules/2.4.20-8/build/include/asm/processor.h: In function `release_segments': /lib/modules/2.4.20-8/build/include/asm/processor.h:457: warning: unused parameter `mm' /lib/modules/2.4.20-8/build/include/linux/prefetch.h: In function `prefetch': /lib/modules/2.4.20-8/build/include/linux/prefetch.h:43: warning: unused parameter `x' /lib/modules/2.4.20-8/build/include/linux/prefetch.h: In function `prefetchw': /lib/modules/2.4.20-8/build/include/linux/prefetch.h:48: warning: unused parameter `x'
- 12-14-2005 #2
I see no errors, only warnings...So what's the big deal?
- 12-15-2005 #3Just Joined!
- Join Date
- Dec 2005
- Posts
- 3
yes, there were only warnings.
Originally Posted by lakerdonald
- 12-15-2005 #4
So what's the probrlem?
- 12-15-2005 #5Just Joined!
- Join Date
- Dec 2005
- Posts
- 3
sorry, i could not point it out. would you tell me the reason?
Originally Posted by lakerdonald


Reply With Quote
