Article View: gnu.g++.bug
Article #1977extern "C" int optind;
From: James Clark
Date: Thu, 11 May 1989 08:44
Date: Thu, 11 May 1989 08:44
19 lines
882 bytes
882 bytes
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
Technical Details
Message-ID:
<8905110844.AA24762@jclark.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!jclark!jjcShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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