From 9100686351190986144
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,ea96cc047f6a22cc
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-08-27 11:13:01 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: joerg.barfurth@attglobal.net (Joerg Barfurth)
Newsgroups: comp.std.c++
Subject: Re: extern "C" -- what is the intent?
Date: Mon, 27 Aug 2001 18:12:36 GMT
Organization: My beloved Family
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1eyrwjj.4sxd9d1050816N%joerg.barfurth@attglobal.net>
References: <090820010209154805%BobbySchmidt@mac.com> <remove.haberg-1008011309410001@du132-226.ppp.su-anst.tninet.se> <rjRvUrB1oAd7Ew7$@ntlworld.com> <remove.haberg-1008012124210001@du136-226.ppp.su-anst.tninet.se> <v0ceBIAA0Hd7EwKT@ntlworld.com> <t3ofp6ft60.fsf@watts.itp.tuwien.ac.at> <I3jnxvAOakh7Ewfp@ntlworld.com>
X-Trace: mail2news.demon.co.uk 998935970 mail2news:3860 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
User-Agent: MacSOUP/D-2.4.6 (unregistered for 412 days)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id EAA06124
Lines: 58
Xref: archiver1.google.com comp.std.c++:7183

Francis Glassborow <francis.glassborow@ntlworld.com> wrote:

> I am away from home and my well thumbed copy of the standard but I thin=
k
> that:
>=20
> extern "C" {
> typedef void (cfntype)(void *);
> }
>=20
> class X
> {
>   static cfntype baz;
> ...
> };
>=20
> deals with that case.

7.5/4 says:
"A C language linkage is ignored for the names of class members and the
member function types of class member functions."

It does not say "non-static class member functions."  The subsequent
example may be misleading, as it supplies a non-static member function
and a static data member which happens to be a pointer to a C function.

Thus the closest workaround you can get is:

  class X
  {
    static cfntype& baz;
  ...
  };

And elsewhere

  extern "C"=20
  static=20
  void X_baz(void*) { /* ...*/ }
 =20
  cfntype & X::baz =3D X_baz;

Here X::baz is a C++- member name naming a C function, as intended.

Regards, Joerg

--=20
J=F6rg Barfurth                         joerg.barfurth@attglobal.net
<<<<<<<<<<<<< using std::disclaimer;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<
Software Developer                    http://www.OpenOffice.org
StarOffice Configuration              http://www.sun.com/staroffice

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



