On Thu, 20 Aug 1998, Jor-el wrote:

> Hi,
> 
>     From the book 'Linux Device Drivers' by Alessandro Rubini :
> 
>     "... The best approach to prevent namespace pollution is to declare
> all your symbols as static and to use a well-defined prefix for the
> symbols you leave as global."
> 
>      By namespace pollution, the author is referring to the problem
> which occurs when device driver writers may create functions / global
> variables that maybe used elsewhere in the kernel.
> 
Yes

>      My question is this : how does using 'static' variables solve this
> problem? I was not aware that static variables / function pointers had
> such a property.
As far as I know, when a variable is declared static it is only accesible
in the current source file, so that it will not conflict with variables
with the same names written in other source files during the linking
process (and inserting a module in the kernel space is a process similar
to linking ...).

Michele

Reply via email to