Re:Practical Guide to Bare Metal C++
by dragontamer on Friday June 02, 2017 @04:57PM
(#14473245)
> Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).
Oh come on. Its not like you see C99 dynamic arrays used very much in Kernel mode.
That's the joy of programming languages. Good programmers use the good parts and ignore the bad parts. C++ has a lot of bad parts (with regards to kernel programming. Such as how most of the STL automatically reallocates memory on its own whims).
So, you ignore the parts that don't work for your task, and the work with the parts that are useful. Very few people have good uses of multiple inheritance anyway.
----------
> Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).
BTW: The -kernel flag in Visual Studio only disables:
* Dynamic Casts (Reflection/RTTI is disabled), Exceptions, and the DEFAULT New / Delete.
Templates, Static_cast / Const_cast and all that good stuff are still available.
Oh come on. Its not like you see C99 dynamic arrays used very much in Kernel mode.
That's the joy of programming languages. Good programmers use the good parts and ignore the bad parts. C++ has a lot of bad parts (with regards to kernel programming. Such as how most of the STL automatically reallocates memory on its own whims).
So, you ignore the parts that don't work for your task, and the work with the parts that are useful. Very few people have good uses of multiple inheritance anyway.
----------
> Also, it's not really C++, it's a pretty serious subset (lacking templates, multiple inheritance, exceptions, reflection, funky new casts [reinterpret_cast, static_cast, dynamic_cast, const_cast], and even namespaces(!)).
BTW: The -kernel flag in Visual Studio only disables:
* Dynamic Casts (Reflection/RTTI is disabled), Exceptions, and the DEFAULT New / Delete.
Templates, Static_cast / Const_cast and all that good stuff are still available.
This is a similar "subset" of C++ that has been chosen for GCC development: https://lwn.net/Articles/542457/