Thanks for your comments all that replied. So to summarize, it seems there are really no technical reasons to not use C++ for base system apps in FreeBSD. A quick look at /usr/src reveals a number of programs that do actually use C++: devd, gperf, groff and OpenSSL. The reasons seem to be more circumstantial or personal: the individual developer simply prefers to use C.
Why did I even ask the question? I perceive correctness as a big problem when programming in C. It is difficult to know for sure that a C program is correct, since there are no guards against mistakes like string buffer overflows, erroneous pointer handling or memory allocation. C++ is of course far from being a golden bullet, but it does solve some of the problems (using C++ strings instead of char* generally means you don't have to worry about string buffer overflows). I realize this is first grade flame war material, so I'll stop with language advocacy now. Yes, I also realize that experience and knowledge are more important than technical language features :) . I've lately started spending some thought on code correctness and reliability. Frankly, I find the current situation appalling. All the time bugs are found even in very well tested software that could easily be prevented or statically recognized by better software construction tools. The big question is, of course, when those tools are available (and some are already), what does it take to get people to use them. Cheers Benjamin
pgpDtYgOoWs7J.pgp
Description: PGP signature