Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!gem.mps.ohio-state.edu!ginosko!uunet!munnari.oz.au!cs.mu.oz.au!ok From: ok@cs.mu.oz.au (Richard O'Keefe) Newsgroups: comp.lang.c Subject: forward declaration of array; how? Keywords: ANSI, forward, static, array Message-ID: <2364@munnari.oz.au> Date: 10 Oct 89 00:51:14 GMT Sender: news@cs.mu.oz.au Lines: 17 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.