lkml.org 
[lkml]   [1997]   [Jan]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
From(Thomas Koenig)
SubjectRe: 2.1.22 unneeded global symbols
Date28 Jan 1997 10:15:08 +0100
In linux.dev.kernel, alan@lxorguk.ukuu.org.uk (Alan Cox) wrote:

>Ah but the following isnt going to work

>foo.c
>
>static void flobble(int x)
>{
>	printf("Kersplat\n");
>}
>
>
>
>bar.c
>
>extern void flobble(int);
>
>int main()
>{
>	register_kersplat_handler(flobble);
>}

Correct.

However, if you changed flobble to extern, my script would no longer
complain about flobble, since it would find a reference to flobble in
both bar.c and foo.c (undefined in bar.c):

[changed 'static' to 'extern' in foo.c, compiled with cc -c]

$ nm *.o

bar.o:
         U flobble
00000000 t gcc2_compiled.
00000000 T main
         U register_kersplat_handler
foo.o:
00000000 T flobble
00000000 t gcc2_compiled.
         U printf

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.094 / U:0.030 seconds]
©2003-2008 Jasper Spaans