C considered dangerous
C considered dangerous
Posted Sep 4, 2018 5:19 UTC (Tue) by ncm (guest, #165)In reply to: C considered dangerous by zlynx
Parent article: C considered dangerous
Complicating the interface for this and similar functions amounts to piling deck chairs on the Titanic into an obstacle course.
It is more than a little stupid to write a new program in C. All the typical pitfalls of pointer manipulations just don't arise in C++. C++ does still have integer overflow UB, as does Rust, and anyway unsigned integers wrapping around is nowhere near so benign as many like to believe.
There would be no problem with C++ in the Linux kernel if not for mindless bigotry, with many fewer opportunities for silly-bugger mistakes, and both faster and shorter code. It will happen eventually. It might happen first in FreeBSD, as the blinkered ancients there are closer to retirement.