DRAFT document on coding conventions in kde libraries

Dirk Mueller mueller at kde.org
Mon Mar 13 15:53:23 GMT 2006


On Monday, 6. March 2006 13:14, Thiago Macieira wrote:

> You're also safe using dynamic_cast<> across modules as long as you're
> casting the object to an exported and well-defined class: this class MUST
> have a virtual destructor and its typeinfo MUST be in a library (which
> means there must be at least one non-inline virtual method in it). I hope
> I'm not wrong here.

I don't think its that easy. Maybe with gcc < 4.0 it was that easy. However, 
with newer compilers, its more or less impossible to get dynamic_cast working 
accross DSO's unless all of them are loaded with global symbol resolution. 

I guess we should switch the default for KDE 4.0 and establish some build 
infrastructure to ensure that all our DSOs don't export random symbols. Thats 
a tough job, but will make a lot of workarounds less necessary. 


-- 
Dirk//\




More information about the kde-core-devel mailing list