DRAFT document on coding conventions in kde libraries

Friedrich W. H. Kossebau Friedrich.W.H at kossebau.de
Mon Mar 6 23:57:24 GMT 2006


Am Montag, 6. März 2006 17:04, schrieb Frerich Raabe:
> On Monday 06 March 2006 16:02, Friedrich W. H. Kossebau wrote:
> > Am Montag, 6. März 2006 15:37, schrieb Frerich Raabe:
> > > On Monday 06 March 2006 15:12, André Wöbbeking wrote:
> > > > On Monday 06 March 2006 14:57, Frerich Raabe wrote:
> > > > > On Monday 06 March 2006 14:33, Frans Englich wrote:
> > > > > > Could you give an example of when one would have to use a C-style
> > > > > > cast?
> > > > >
> > > > > When casting the pointer returned by dlsym to the correct type, for
> > > > > example.
> > > >
> > > > reinterpret_cast<>() doesn't work in this case?
> > >
> > > No.
> >
> > Hm. Please teach here why :)
> > dlsym returns "void *"? And that could not be "reinterpreted" to the
> > supposed type?
>
> That is right. void* can be a data pointer or a function pointer. You can
> just google for 'c style cast dlsym' for many hits about this issue - and I
> think I even saw some open-std entry for this at some point. Here's an
> interesting quote for you:

Thanks for the detailed answer, marked for concentrated reading iff time. :)

> The difficult part about all those fancy C++ casts and C++ patterns and
> whatnot is to decide when you should *not* apply them.

"But I've got this hammer, are you sure it's not really a nail?" :P

Regards
Friedrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060307/c9c2fa32/attachment.sig>


More information about the kde-core-devel mailing list