3 ms·
> One could argue that C++ is much more complex and hard to write correct code. That is why in the Windows kernel, according to https://en.wikipedia.org/w/inde
by aleph_minus_one 3y ago
> One could argue that C++ is much more complex and hard to write correct code.
That is why in the Windows kernel, according to https://en.wikipedia.org/w/index.php?title=Windows_NT&oldid=1160073073#Programming_language https://en.wikipedia.org/w/index.php?title=Windows_NT&oldid=..., C++ is rather avoided, and C is preferred for kernel code (for user-mode code, the priorities are reversed):
"Windows NT is written in C and C++, with a very small amount written in assembly language. C is mostly used for the kernel code while C++ is mostly used for user-mode code. Assembly language is avoided where possible because it would impede portability."
- pjmlp 3y agoSomeone has to update that entry, C++ supported in the kernel since Vista, https://learn.microsoft.com/en-us/cpp/build/reference/kernel-create-kernel-mode-binary?view=msvc-170 https://learn.microsoft.com/en-us/cpp/build/reference/kernel... "The new wil library for C++ code in drivers" https://community.osr.com/discussion/291326/the-new-wil-library-for-c-code-in-drivers https://community.osr.com/discussion/291326/the-new-wil-libr... > wil was primarily developed by the Windows shell team for writing usermode code, but the NDIS and Bluetooth teams have contributed some small kernel-specific features. Here's a few examples of how you can use wil in your kernel driver:
- tonyedgecombe 3y ago>C is mostly used for the kernel code >C++ supported in the kernel since Vista Both of those things code be true.