🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #38362

Re: C++ and callbacks

#38362
From: James Kanze
Date: Fri, 06 May 1994 11:23
21 lines
1992 bytes
In article <JASON.94May5173436@deneb.cygnus.com> jason@cygnus.com
(Jason Merrill) writes:

|> >>>>> Brandon Van Every <brandon@uncvx2.oit.unc.edu> writes:

|> > I can't find anything in Stroustrup that says this will work.  The default
|> > linkage for all functions is "C++" (p. 524).  Given that, I'd say that not
|> > using "extern C" is rather risky.

|> But does anything say that it won't?  C and C++ use the same calling
|> convention for plain functions, so C linkage v. C++ should have no effect
|> on function pointers.

System dependant.  What Jason Merrill says is true for g++ and for
cfront, but I wouldn't expect it to be generally true.  (It wasn't for
Zortech, for example.)
--
James Kanze                       email: kanze@lts.sel.alcatel.de
GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                   -- Beratung in industrieller Datenverarbeitung
Technical Details
Message-ID: <KANZE.94May6122340@slsvhdt.us-es.sel.de>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!hookup!swrinde!cs.utexas.edu!howland.reston.ans.net!xlink.net!slsv6bt!slsv6bt!kanze
References: <pauld.767898877@sarge> <2q65gv$oln@bigblue.oit.unc.edu> <2q67fpINNgv5@eccdb1.pms.ford.com> <2q9v55$ted@bigblue.oit.unc.edu> <JASON.94May5173436@deneb.cygnus.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103734,ad5a39011a2d3d26
X-Google-Attributes: gid103734,public
X-Google-Thread: 109fba,ad5a39011a2d3d26
X-Google-Attributes: gid109fba,public
X-Google-Thread: 10ba33,ad5a39011a2d3d26
X-Google-Attributes: gid10ba33,public
X-Google-ArrivalTime: 1994-05-06 04:08:29 PST
Newsgroups: comp.windows.x,comp.lang.c++,gnu.g++.help
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!hookup!swrinde!cs.utexas.edu!howland.reston.ans.net!xlink.net!slsv6bt!slsv6bt!kanze
From: kanze@us-es.sel.de (James Kanze)
Subject: Re: C++ and callbacks
In-Reply-To: jason@cygnus.com's message of Fri, 6 May 1994 00:34:36 GMT
Message-ID: <KANZE.94May6122340@slsvhdt.us-es.sel.de>
Followup-To: comp.windows.x,comp.lang.c++,gnu.g++.help
Sender: news@lts.sel.alcatel.de
Organization: SEL
References: <pauld.767898877@sarge> <2q65gv$oln@bigblue.oit.unc.edu>
 <2q67fpINNgv5@eccdb1.pms.ford.com> <2q9v55$ted@bigblue.oit.unc.edu>
 <JASON.94May5173436@deneb.cygnus.com>
Date: 06 May 1994 11:23:40 GMT
Lines: 21