Re: static int __init foobar_init(void) {}

From: Jeff Garzik (jgarzik@mandrakesoft.mandrakesoft.com)
Date: Mon Mar 13 2000 - 09:01:59 EST


On Mon, 13 Mar 2000, Jean-Christian de Rivaz wrote:

> I get confused by many warning while compile 2.3.51. gcc warn: init and
> exit functions aren't used in many modules. Is the probleme only the
> static word or something more important explain the current state ?
>
> In fact, when writing a module driver, what is correct ?
>
> static int __init foobar_init(void) {}
> module_init(foobar_init);

This is correct.

> int __init foobar_init(void) {}
> module_init(foobar_init);

This is wrong. It exists because people want to avoid the warnings
emitted by gcc. Patches to clean this up would be a good idea...

        Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:25 EST