Re: 2.1.22 unneeded global symbols

Thomas Koenig (
25 Jan 1997 19:05:51 +0100

In, (Alan Cox) wrote:

>Its wrong. Your script needs to handle inline function export names and
>also assembler and references buried in include files. Also function
>names used as variables and passed directly or indirectly to functions.

If you want to pass a pointer to a variable to somewhere else, it doesn't
have to be extern; it can be made static.

In other words, code like


char *foo_msg(void);


#include "foo.h"

static char msg[]="This is an important message."

char *foo_msg()
return msg;

is perfectly all right, and doesn't pollute the global namespace with
the variable "msg".

You can pass addresses to static functions the same way.