C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Vtable layout and C++ compilers.

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Neo
Guest





PostPosted: Thu Dec 28, 2006 10:10 am    Post subject: Vtable layout and C++ compilers. Reply with quote



Hi Friends,
Is virtual function table layout (VTABLE) is compiler dependent?

Regards
Vikram S
Back to top
Rolf Magnus
Guest





PostPosted: Thu Dec 28, 2006 10:10 am    Post subject: Re: Vtable layout and C++ compilers. Reply with quote



Neo wrote:

Quote:
Mathias Gaunard wrote:
Neo wrote:
Hi Friends,
Is virtual function table layout (VTABLE) is compiler dependent?


Yes.
There is not even a guarantee that a vtable is used.

is such situation, there is not guarantee that polymorphism will work
across component compiled by different compilers and it is against one
of the manjor features of C++.

Which would be...?
You have to look at the ABI that the compiler implements. If it's the same
for both compilers, it should be possible to link together object code
generated by both compilers. Note that there is a whole lot more about the
ABI than just vtables. Think about how values are passed to functions, how
they are returned, how function names are mapped to internal symbol names
(so-called name mangling), how exceptions are thrown and so on.
ISO C++ deliberately doesn't define how that is done to give compiler
implementors more freedom. There are many different hardware/OS
combinations, and the way how to do things best can depend on those.

Quote:
One thining I would like to mention that all COM (component object
model) component functionality is all based on standard vtable layout
and Microsoft claims that COM specification works for all compilers and
platforms.

I think the only difference here is that the ABI requirement is reduced to a
common C ABI instead of a common C++ ABI.
Back to top
Gianni Mariani
Guest





PostPosted: Thu Dec 28, 2006 10:10 am    Post subject: Re: Vtable layout and C++ compilers. Reply with quote



Neo wrote:
Quote:
Hi Friends,
Is virtual function table layout (VTABLE) is compiler dependent?

Yes. There is nothing mandated in the standard about vtables.
Back to top
Mathias Gaunard
Guest





PostPosted: Thu Dec 28, 2006 10:10 am    Post subject: Re: Vtable layout and C++ compilers. Reply with quote

Neo wrote:
Quote:
Hi Friends,
Is virtual function table layout (VTABLE) is compiler dependent?


Yes.
There is not even a guarantee that a vtable is used.
Back to top
Neo
Guest





PostPosted: Thu Dec 28, 2006 10:10 am    Post subject: Re: Vtable layout and C++ compilers. Reply with quote

Mathias Gaunard wrote:
Quote:
Neo wrote:
Hi Friends,
Is virtual function table layout (VTABLE) is compiler dependent?


Yes.
There is not even a guarantee that a vtable is used.

is such situation, there is not guarantee that polymorphism will work
across component compiled by different compilers and it is against one
of the manjor features of C++.
One thining I would like to mention that all COM (component object
model) component functionality is all based on standard vtable layout
and Microsoft claims that COM specification works for all compilers and
platforms.
Back to top
kuoxin
Guest





PostPosted: Thu Dec 28, 2006 10:10 am    Post subject: Re: Vtable layout and C++ compilers. Reply with quote

"COM specification works for all compilers and platforms." -- It is
impossible if Microsoft do not make the implementation in platforms.

"Neo :
"
Quote:
Mathias Gaunard wrote:
Neo wrote:
Hi Friends,
Is virtual function table layout (VTABLE) is compiler dependent?


Yes.
There is not even a guarantee that a vtable is used.

is such situation, there is not guarantee that polymorphism will work
across component compiled by different compilers and it is against one
of the manjor features of C++.
One thining I would like to mention that all COM (component object
model) component functionality is all based on standard vtable layout
and Microsoft claims that COM specification works for all compilers and
platforms.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.