This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting a pointer to a vtable


On 26/03/12 22:55, Mike Hommey wrote:
> On Mon, Mar 26, 2012 at 01:48:45PM -0700, Ian Lance Taylor wrote:
>> There is no macro that does mangling, no.
>>
>> Why not simply
>>
>> void *bar = &foo;
> I want a pointer to the vtable.
>
> Mike
Isn't the vtable stored as the first class 'member'?
So  struct VtableFoo** v = (struct VtableFoo**)&foo; _would_ work
(abusing the internals...).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]