TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: PAUL WANKADIA
from: PETER GARNER
date: 1997-06-06 09:32:00
subject: C++ linkage

PW> .MSGID: 3:640/772.3 c14611c6
PW> I've noticed that gcc likes to mangle my C++ functions by adding info 
about
PW> the parameters to the end of the symbol.  Of course, this is ridiculous 
when
PW> I want to call these functions from ASM code, so I was wondering if there 
was
PW> a way of preventing that kind of mangling from occurring.  TIA.
PW> 
PW> --- PPoint 2.00
   Er.. Yes and no.  ALL C++ compilers do name mangling.  This is how 
functions are overloaded.  In general it is a bad Idea to call C++ 
from ASM since [non-static] C++ member functions are passed an 
implicit pointer to the object upon which they operate. (The "this" 
pointer, about which you may have heard.)  The best way to avoid this 
is to redefine the methods you want to call from ASM as "C" instead of
as C++.
Good Luck
Pedro
---
 þ KWQ/2 1.2i þ If at first you don't succeed, put it out for beta test.
---------------
* Origin: St. Louis Users Group (1:100/4)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.