Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!uunet!munnari.oz.au!cs.mu.oz.au!ok From: ok@cs.mu.oz.au (Richard O'Keefe) Newsgroups: comp.lang.c Subject: Re: forward declaration of array; how? Keywords: ANSI, forward, static, array Message-ID: <2398@munnari.oz.au> Date: 12 Oct 89 03:21:52 GMT References: <2364@munnari.oz.au> <14868@haddock.ima.isc.com> Sender: news@cs.mu.oz.au Lines: 18 In article <2364@munnari.oz.au> ok@cs.mu.oz.au (Richard O'Keefe) writes: > extern void (*(dispatch[]))(); > static void (*(dispatch[]))() = { ... foo, ..., baz, ... }; In article <14868@haddock.ima.isc.com>, karl@haddock.ima.isc.com (Karl Heuer) writes: : The ANSI way to do this is to use `static' rather than `extern' in the first : declaration. I received E-mail from two other people suggesting this. It's obvious enough, in all conscience, to make the two declarations agree about the storage class. The trouble is that the nearest thing to an ANSI compiler available to me is gcc 1.36, which doesn't like it. As the man says: : Unfortunately, not all existing pre-ANSI compilers agree with this. Oh well, I should have known I was asking for trouble when I had to use the extern/static hack to make the PDP-11 compiler happy way back when.