[lkml]   [2001]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectbasic module bug
What's wrong with this minimal module?

/* test module */
#ifndef __KERNEL__
#define __KERNEL__
#ifndef MODULE
#define MODULE
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/malloc.h>
#ifdef MODULE
int init_module(void)
int test_init(void)
return 0;
#ifdef MODULE
void cleanup_module(void)

both egcs 2.91.66 and redhat's gcc 2.96-85 barf on it:

In file included from /usr/src/linux/include/asm/semaphore.h:11,
from /usr/src/linux/include/linux/fs.h:198,
from /usr/src/linux/include/linux/capability.h:17,
from /usr/src/linux/include/linux/binfmts.h:5,
from /usr/src/linux/include/linux/sched.h:9,
from /usr/src/linux/include/linux/mm.h:4,
from /usr/src/linux/include/linux/slab.h:14,
from /usr/src/linux/include/linux/malloc.h:4,
from test.c:11:
/usr/src/linux/include/asm/current.h:4: global register variable follows a function definition
/usr/src/linux/include/asm/current.h:4: warning: call-clobbered register used for global register variable

What have I done wrong?

-- Bob

Bob McElrath (
Univ. of Wisconsin at Madison, Department of Physics
[unhandled content-type:application/pgp-signature]
 \ /
  Last update: 2005-03-22 12:58    [W:0.040 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site