DRAFT document on coding conventions in kde libraries

Friedrich W. H. Kossebau Friedrich.W.H at kossebau.de
Mon Mar 6 15:02:02 GMT 2006


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?

Would it be an idea then to mark such needed C-style cast with a makro, to 
make it distinct from wrong use? E.g.
  SupposedType var = kmodule_cast(SupposedType)( SomeSymbol );
given
  #define kmodule_cast(x) (x)
perhaps?

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/20060306/e852dafe/attachment.sig>


More information about the kde-core-devel mailing list