Hacker News new | ask | show | jobs
by milkey_mouse 2698 days ago
> The [Linux] kernel already contains some C++

Are you sure? I don't think the kernel even compiles with a C++ compiler [1]. Also, I just ran cloc on my linux repo and didn't get any actual C++ code.

Perhaps some external kernel modules are written in C++, but that seems like a bad idea too [2].

[1] https://www.phoronix.com/scan.php?page=news_item&px=45-Linux... [2] https://www.threatstack.com/blog/c-in-the-linux-kernel

1 comments

That [1] was what I remembered. They were preparing for C++. But obviously it didn't get as far as actually including C++ code in the mainline kernel. Maybe it was a preparation in order to allow experimenting with C++ in the kernel.