forward declaration of array; how?
Richard O'Keefe
ok at cs.mu.oz.au
Tue Oct 10 10:51:14 AEST 1989
I have a program which uses a statically initialised array of function
pointers (a couple of hundred of them). At the moment, the file which
contains the array looks like
...
extern void (*(dispatch[]))();
...
void foo() { ... (*dispatch[i])(); ... }
...
void baz() { ... (*dispatch[j])(); ... }
...
static void (*(dispatch[]))() = { ... foo, ..., baz, ... };
...
I want to make the program ANSI-conformation. GCC prints a warning about
this; it doesn't like dispatch[] being extern and static both. Neither
do I, but it was the only way I could talk another C compiler into accepting
it. How should I organise this in ANSI C? I'd really rather _not_ add
a couple of hundred function prototypes.
More information about the Comp.lang.c
mailing list