LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 794|回复: 3

按照<<Begin Linux Programming>> Wrox出版的红皮书编

[复制链接]
发表于 2004-12-14 16:53:10 | 显示全部楼层 |阅读模式
gcc -D__KERNEL__ -I/usr/src/linux-2.4.20-8/include -DMODULE -Wall -O2   -c -o schar.o schar.c
schar.c:41: warning: initialization from incompatible pointer type
schar.c:42: warning: initialization from incompatible pointer type
schar.c:44: warning: initialization from incompatible pointer type
schar.c:45: warning: initialization from incompatible pointer type
schar.c:46: warning: initialization from incompatible pointer type
schar.c:47: warning: initialization from incompatible pointer type
schar.c:49: warning: initialization from incompatible pointer type
schar.c: In function `schar_mmap':
schar.c:182: warning: passing arg 1 of `remap_page_range_R2baf18f2' makes pointer from integer without a cast
schar.c:182: incompatible type for argument 4 of `remap_page_range_R2baf18f2'
schar.c:182: too few arguments to function `remap_page_range_R2baf18f2'
schar.c: In function `init_module':
schar.c:450: warning: implicit declaration of function `MAP_NR'
schar.c:450: invalid type argument of `->'
schar.c:462: structure has no member named `fill_inode'
schar.c: In function `cleanup_module':
schar.c:483: invalid type argument of `->'
发表于 2004-12-14 17:34:57 | 显示全部楼层
内核编程的还是看看其它介绍内核模块编译的书吧,要比这本讲得完整。
发表于 2004-12-14 17:56:50 | 显示全部楼层
是41行的问题就去看看41行,是42行的问题就去看看42行,光打几条错误信息出来,谁知道是什么问题
发表于 2004-12-14 23:55:14 | 显示全部楼层
schar.c:182: incompatible type for argument 4 of `remap_page_range_R2baf18f2'

很奇怪的变量命名,不知道是typo,
还是编译器用了name mangling.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表