![]() | |||||||||||||
Messages in this thread |
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 | |||||||||||||