From 8646613215585254610
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,3b852614b232b53b
X-Google-Attributes: gidf78e5,public
From: James Kuyper <kuyper@wizard.net>
Subject: Re: function pointer types(was: Re: atexit() behavior)
Date: 1998/12/02
Message-ID: <36655968.41C6@wizard.net>#1/1
X-Deja-AN: 417929914
X-NNTP-Posting-Host: gscsgi02.gsfc.nasa.gov
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <365f3482.0@10.1.1.65> <73vc1v$5oe$1@nnrp1.dejanews.com> <fneilYAeA0Y2Ewh7@robinton.demon.co.uk> <3663B9D8.283B0424@physik.tu-muenchen.de> <741t78$a8v$1@nnrp1.dejanews.com> <Fb2kqKA6eIZ2EwoP@robinton.demon.co.uk>
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=us-ascii
Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


Francis Glassborow wrote:
...
> A linkage specifier applies to all parts of a declaration.

> That leaves a problem as to how you write a C++ linkage  function that
> takes a pointer to C linkage function (or any other combination you
> like)

> To do this you have to use a typedef:

> extern "C" {
>         typedef  void (*Cfunc_ptr)();
> }

> void func_cpp( Cfunc_ptr);

> I believe this is one of those places where the grammar allows you to do
> something with a typedef that cannot be written otherwise.

I think that it's the only such place. Why does the standard require
this workaround?


[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




