> >> OP>         = PTHREAD_MUTEX_INITIALIZER;
> OP> rtl-3.0preX ??
> i dont't think that rtl has influence on the stl? why should rtl
> define a macro which is used only by the c++ stl?
The RTL posix interface I guess. As I remember the STL of libstdc++/gcc-2.95.2
isn't thread save and I wonder to find the above statements. Maybee only some
container are thread save.
The problem relays to:
# grep PTHREAD_MUTEX_INITIALIZER /usr/include/rtlinux/*
[...]
/usr/include/rtlinux/rtl_mutex.h:#define PTHREAD_MUTEX_INITIALIZER { 0,0,1, 
SPIN_LOCK_UNLOCKED, PTHREAD_MUTEX_DEFAULT, RTL_WAIT_INITIALIZER, PTHREAD_PRIO_NONE }   
      

I've no idea wher the include come from. It occours only by mixing kernel and
stl includes using 
g++ -I/usr/include/linux @RTL_INC@ ....

> OP> rtti needs typeinfo's which are compiler spezific as I assume.
> OP> You can use an overlaoded int type() whih returns an unique id of each class.
> OP> Than you can compare a->type() == b->type(). dynamic_cast throws as well - here
> does it? i thought that it will return a null pointer if there is no
> cast possible ...
I agree, but Stroustrup "The Std C++ Language" De/4.Ed pg 410: bad_cast throws
by dynamic_cast, or Chapter 15.4.1. Dynamic cast of references. Summary:
bad_cast  will only be thrown on wrong arguments.

> OP> Only of interest ist __do_global_dtors_aux && __do_global_ctors_aux for
> OP> globals imo. No idea about the rest like _register_frame_info yet.
> do you link against the stdlibs or against nothing at all (means no
> startup code)?
No startup code, I've need it not yet. At moment I write a small libkcpp for me
(there is only strerror, perror, new/delete und a errno class- which will be
replaced by a normal int maybee later). The only lib I link is the libm.a 

> OP>  > but when i use c-style casts like the following:
> >> 
> >>     SomeDerivedClass* pDC = new SomeDerivedClass;
> >>     void* pv = (void*) (pDC);
> >>     SomeBaseClass* pBC = (SomeBaseClass*) pv;
> >> 
> >> same for downcasts:
> >> 
> >>      SomeBaseClass *pBC;       // assuming that pBC stores a
> >>                                // link to some derived class of
> >>                                // SomeBaseClass!
> >>      ...
> >> 
> >>      void* pv = (void*) pBC;
> >>      (SomeDerivedClass*) (pBC)->DoSomething();
> >> 
> >> this perfectly works even with the -fno-rtti flag set ...
> OP> C-cast ... you know what you do - they are not type safe, so if you cast wrong
> OP> and use it, you can reboot (maybee).
> probably it will reboot the machine by itself |*7 ... but i have got
> some experience with rebooting and locking up my system now ... ;-)
Me too >8)

Olaf

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to