lkml.org 
[lkml]   [2000]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: static int __init foobar_init(void) {}


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);

It should be correct. Yes, gcc complains here. What actually happens is
that

static void foo(void) {baz();barf();}
void bar(void) __attribute(alias(foo));

is correctly compiled (resulting code consists of a function that calls
baz() and barf(), foo is equal to bar and both point to the beginning of
that function, only bar is visible outside of file), but gcc complains
about foo() being static and never called. Which is technically true
(defining alias != calling), but is pretty meaningless.

Could gcc folks comment on that? IMO counting alias as valid use is a
reasonable idea...


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.077 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site