Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!jclark!jjc From: jclark!jjc@UUNET.UU.NET (James Clark) Newsgroups: gnu.g++.bug Subject: extern "C" int optind; Message-ID: <8905110844.AA24762@jclark.uucp> Date: 11 May 89 08:44:00 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 19 I'm a bit confused about whether `extern "C"' is applicable to data as well as functions. I was using getopt(), so I declared `optind' as: extern "C" int optind; It turned out that this causes a definition of optind to be emitted, which seems to prevent getopt() from working. Declaring it as extern int optind: makes it work. So is `extern "C"' supposed to work with data? If so, how do you say that you want to refer to something, not define it? James Clark jjc@jclark.uucp