Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: extern Message-ID: <16994@haddock.ima.isc.com> Date: 30 Jun 90 18:56:24 GMT References: <111254@linus.mitre.org> <910@bjcong.bj.co.uk> <277@taumet.com> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 20 In article <277@taumet.com> steve@taumet.UUCP (Stephen Clamage) writes: >The usual trick is then to do something like this: > #define EXTERN extern In rebuttal, I'd like to mention that many of us find this grotesque, and prefer to use /* header.h */ extern int foo[20]; extern double bar; /* something.c */ #include "header.h" int foo[20]; double bar = 3.0; which is also completely portable, doesn't require preprocessor games, and allows the objects to have initializers (this can sometimes be done with your method too, but it makes it even uglier). Since the defining source file also includes the header, you can't get them out of sync. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint