4 ms·
> the Windows kernel and win32 libraries written in C and the application in C++ To my knowledge the kernel and win32 is in fact written in C++ and only the in
by jpc0 2y ago
> the Windows kernel and win32 libraries written in C and the application in C++
To my knowledge the kernel and win32 is in fact written in C++ and only the interface has C linkage and follows C norms.
So this error occurred going C++ > C > C++ never mind languages with different memory protection mechanisms like Rust > C > C++.
- rurban 2y agoNo, the windows kernel is written in pure C.
- cryptonector 2y agoI believe it's C++, but not allowed to use exceptions.
- rurban 2y agoWe know that it's pure C, because it leaked.
- cryptonector 2y agoAll of it is C?
- layer8 2y agoIt’s an unholy combination of C, C++, and Microsoft extensions at worst. But apart possibly from some COM-related DLLs, the spirit is clearly C, and C++ exceptions are generally not expected. (There may be use of SEH in some parts.) Of course, you can write C++ without exception safety too, but “C++ as a better C” and exception-safe C++ are effectively like two different languages.
- ryao 2y agoI filed bugs against both GCC and LLVM asking for compiler warnings that would inform developers of the risk: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118263 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118263 https://github.com/llvm/llvm-project/issues/121427 https://github.com/llvm/llvm-project/issues/121427