This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ignorant question about printf warnings for pointer-to-memberfunctions
- From: Michael Matz <matz at suse dot de>
- To: Matthias Benkmann <matthias at winterdrache dot de>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 2 Dec 2002 15:12:01 +0100 (CET)
- Subject: Re: Ignorant question about printf warnings for pointer-to-memberfunctions
Hi,
On Sat, 30 Nov 2002, Matthias Benkmann wrote:
> p.s.: It would be very nice if someone could give a (pointer to a) brief
That's a detail of the C++ ABI, and ergo is specified here:
http://www.codesourcery.com/cxx-abi/abi.html#member-pointers
> explanation of how GCC implements member pointers. Is it the same
> structure for data members and methods, virtual and non-virtual?
Well, data members are not virtual or something, so a simple address is
enough to describe pointers to data members. And pointer to member
functions are composed of a pointer, which holds a normal (C) function
pointer in case of pointing to a non-virtual function, or a vtable offset
+ 1 for a virtual function, and an adjustement field for the this pointer.
Note, that what is a "normal" function pointer is also architecture
specific, and can differ quite much from a simple data pointer (e.g. for
itanium it's a pointer to a pair of a function address (into the .text
section) and the GP value.
Ciao,
Michael.