This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ Calling Conventions
- To: mhs68 at crosswinds dot net
- Subject: Re: C++ Calling Conventions
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 5 Feb 2000 16:21:40 +0100
- CC: gcc at gcc dot gnu dot org
- References: <001301bf6fe6$99b991e0$1d817d3e@mikeharris>
> Can anyone point me towards information describing calling conventions
> for C++?
The information is spread all over the world. Typically, C++ compilers
conform to the C calling conventions for pure C code, and only extend
those. So the various C ABI specifications provide a starting
point. Another starting point is the ARM.
> Do the ANSI/ISO standards specify calling conventions? Or are they
> compiler specific?
The standard does not specify an ABI; so far, they are compiler
specific. For g++, you'll find more information in gxxint.texi.
> Can the above mentioned standards be downloaded from anywhere, or does
> one have to buy them?
A C++ ABI is under development for C++; you can find the existing
pieces at
http://reality.sgi.com/dehnert_engr/cxx/cxx-summary.html
> I'm particularly interested in method invocation is implemented,
> especially virtual method invocation.
In most compilers, (non-static) methods take an additional implicit
parameter, representing 'this'. This parameter is typically
implemented passed as a pointer, and as the first argument.
Virtual methods are typically implemented by means of a 'virtual
function table'. You'll find more about these in gxxint.texi.
Regards,
Martin