slurper said:
i encounter regularly in the linux source code signatures like this:
static void __init do_initcalls(void)
{
definition(whatever)
}
"__init" en "do_initcalls" are two different words. how must one interpret
this? i don't understand a function definition with two separate words.
anybody can explain me this?
You shouldn't expect things like kernels to be clean, standard
conforming C - lots and lots of non-portable, compiler-dependend
extensions are typically used. A place where this kind of questions
is on-topic is e.g. comp.os.linux.development.system, here in clc
they are heavily frowned upon since they are compiler- and platform
dependend. In "clean" C the only possibility I can see at the moment
to make that __init stuff at least halfway legal would be by having
a define somewhere before like
#define __init
i.e. by making it invisible or with
#define __init *
(but in this case you would also have to change the function to make
it return a void pointer;-)
<OT>
To satisfy you're curiosity have a look at the init.h header file
in the kernel sources - you will find that __init is defined as
some gcc-supplied extension, a function attribute, which gives
the compiler some additional hints on how the function is going
to be used - nothing you can do in standard C.
</OT>
Regards, Jens