mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* basic module bug
@ 2001-08-25  5:59 Bob McElrath
  2001-08-25 11:21 ` Evgeny Polyakov
  0 siblings, 1 reply; 6+ messages in thread
From: Bob McElrath @ 2001-08-25  5:59 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]

What's wrong with this minimal module?

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

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?

Thanks,
-- Bob

Bob McElrath (rsmcelrath@students.wisc.edu) 
Univ. of Wisconsin at Madison, Department of Physics

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-08-25 21:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-25  5:59 basic module bug Bob McElrath
2001-08-25 11:21 ` Evgeny Polyakov
2001-08-25 15:27   ` Bob McElrath
2001-08-25 15:56     ` Bob McElrath
2001-08-25 19:04     ` Evgeny Polyakov
2001-08-25 21:03       ` Bob McElrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®