C++ kernel programming with RTTI

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

C++ kernel programming with RTTI

Post by Candy »

Does anyone have any experience with this? Does anybody have some info pointers?

Do you need RTTI for polymorphism?

How is RTTI handled by GCC (3.3.*) ?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:C++ kernel programming with RTTI

Post by Pype.Clicker »

http://www.codesourcery.com/cxx-abi/
http://www.informit.com/isapi/guide~cpl ... ontent.asp

Afaik, RTTI isn't required for polymorphism, but only for <dynamic cast> operator ...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:C++ kernel programming with RTTI

Post by Solar »

No experience on my part. I'd daresay you don't need RTTI - or rather, if you need it, it's probably a sign that your design is screwed up...

As much as I understand your desire to have all bells & whistles enabled up front - hell, I've been there myself a year or so ago - I'd advice you start without RTTI enabled, and see whether this poses to be a problem at all for your kernel.
Every good solution is obvious once you've found it.
libber

Re:C++ kernel programming with RTTI

Post by libber »

Not just synamic cast, but also catch and throw and and a few others i believe. I also don't think you need RTTI. but to get RTTI working you need a few libraries like libgcc_s and more importantly libstdc++.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:C++ kernel programming with RTTI

Post by Pype.Clicker »

libstdc++ for RTTI and exception handling ?? i wouldn't bet on this ... If you have any evidence things are so, i'd be interrested.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:C++ kernel programming with RTTI

Post by Solar »

He probably meant libsupc++ - libstdc++ is the standard library, i.e. streams, STL and stuff.

I haven't delved into the portability of libsupc++ myself, yet, but if that's of a breed similar to glibc, I'll pass, thank you. ;-)
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:C++ kernel programming with RTTI

Post by Candy »

Solar wrote: He probably meant libsupc++ - libstdc++ is the standard library, i.e. streams, STL and stuff.
That doesn't explain the name not being libstl or libstlc++, the absence of every iterator and collection, and the presence of a number of files starting with eh* and files like rtti.cpp
I haven't delved into the portability of libsupc++ myself, yet, but if that's of a breed similar to glibc, I'll pass, thank you. ;-)
can tell, yup, it's as clear as gold (gold has a very high density, and is not clear, if you didn't guess it). Tried to read a part of it, but I happened to print the wrong pages (headers of 20 pages with three lines of interest: inclusion of a different header, 19.9 pages for the old format, one inclusion of a DIFFERENT file for the content with the actual c++ format, and the end-of-file line...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:C++ kernel programming with RTTI

Post by Solar »

Candy wrote: That doesn't explain the name not being libstl or libstlc++...
Common misconception: The STL is a subset of the C++ standard library. There are parts of the standard library that have nothing to do with the STL.
...the absence of every iterator and collection...
I haven't looked at the internals of either lib yet, but you are aware that both iterators and collections would be defined in headers, since they are templates which - pending support for the "export" keyword in gcc - can't split declaration and definition?
...and the presence of a number of files starting with eh* and files like rtti.cpp
Exception handling is a bloody, compiler-implementation-dependent mess. :(
Every good solution is obvious once you've found it.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:C++ kernel programming with RTTI

Post by Candy »

Solar wrote: Common misconception: The STL is a subset of the C++ standard library. There are parts of the standard library that have nothing to do with the STL.
uh... ok... Still don't expect it to be there.
...the absence of every iterator and collection...
I haven't looked at the internals of either lib yet, but you are aware that both iterators and collections would be defined in headers, since they are templates which - pending support for the "export" keyword in gcc - can't split declaration and definition?
There were some big-@$$ files in there (hundreds of K's), must admit I didn't even give them a look. Will look tomorrow.
Exception handling is a bloody, compiler-implementation-dependent mess. :(
So true. It was indeed a mess... Did you call 112 yet (or 0900-8844 if it isn't urgent)?

Translation for those nonconforming USers: 112 is the european 911.
Post Reply