🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #38346

Re: C++ and callbacks

#38346
From: Ronald F. Guilmette
Date: Sat, 07 May 1994 20:08
37 lines
2579 bytes
In article <CpEBxp.9w2@news.cis.umn.edu> ianhogg@milli.cs.umn.edu (Ian J Hogg) writes:
>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.
>
>Where does anything say that C and C++ use the same calling convention for 
>plain functions.

In the case of fully prototyped functions, I cannot imagine any good
reason why this should NOT be the case.  Can you?  If so, I would love
to hear the reason.

>As I've stated before I know of at least one compiler that
>passes arguments for C++ linkage functions differently than C linkage functions.

OK.  So why don't you stop beating around the bush and tell us which compiler
you are referring to.  (You don't expect us just to take you word for it
do you??)

>Are you saying this compiler is broken?

If no one else does, then I will say (at least) that the compiler in question
is screwy and/or that it generates code (in one language or the other) which
is less efficient (in terms of parameter passing) than it should be.

-- 

-- Ron Guilmette, Sunnyvale, CA ---------- RG Consulting -------------------
---- domain addr: rfg@netcom.com ----------- Purveyors of Compiler Test ----
---- uucp addr: ...!uunet!netcom!rfg ------- Suites and Bullet-Proof Shoes -
Technical Details
Message-ID: <rfgCpG7y7.3BF@netcom.com>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!hookup!swrinde!ihnp4.ucsd.edu!library.ucla.edu!csulb.edu!csus.edu!netcom.com!rfg
References: <2q9v55$ted@bigblue.oit.unc.edu> <JASON.94May5173436@deneb.cygnus.com> <CpEBxp.9w2@news.cis.umn.edu>

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-07 13:22:11 PST
Newsgroups: comp.windows.x,comp.lang.c++,gnu.g++.help
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!hookup!swrinde!ihnp4.ucsd.edu!library.ucla.edu!csulb.edu!csus.edu!netcom.com!rfg
From: rfg@netcom.com (Ronald F. Guilmette)
Subject: Re: C++ and callbacks
Message-ID: <rfgCpG7y7.3BF@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <2q9v55$ted@bigblue.oit.unc.edu> <JASON.94May5173436@deneb.cygnus.com> <CpEBxp.9w2@news.cis.umn.edu>
Date: Sat, 7 May 1994 20:08:31 GMT
Lines: 37