On Mon, 2008-06-09 at 11:46 +0200, Giovanni Di Stasi wrote:
> Il Tuesday 03 June 2008 11:49:49 Bernd Petrovitsch ha scritto:
> > Giovanni Di Stasi wrote:
> > > Hello there,
> > > do  you see any issues in developing an olsr plugin in C++?
> >
> > Only the usual linking problems with libstdc++ which one has to get
> > right and I don't know about missing necessary initializations ....
> 
> What initializations? Of objects?

E.g. constructors (and destructors) of global objects (of your
C++-plugin).
Missing destructor calls usually (depending on what they do) don't
really hurt though.

And there may be other missing initializations for the RTTI or exception
handling or other C++ stuff I actually don't know about.

Of course if your plugin doesn't use that fancy C++ stuff and 'extern
"C"' everything it might work somehow.
But if your plugin doesn't use that fancy C++ stuff, why do you want to
use it in the first place?

BTW the complete other approach is to (try to) compile the whole beast
with g++. But that will very probably give lots of warnings (even if you
comment appropriate lines in Makefile.inc out) - e.g. "missing" pointer
type casts of "void *"[0] which are more than superfluous in C (so I
usually simply kill them on sight) and I don't think adding them buys
anything.
And you have also to cope with the dynamic plugin loading.

	Bernd

[0]: No, I can't think of any good reason to have them. No, I don't know
     why people have those (and even think it's "beautiful").
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




