Converting GCC to C++
Posted Jun 18, 2008 16:18 UTC (Wed) by
pphaneuf (subscriber, #23480)
Parent article:
Converting GCC to C++
This is good news, I think.
I have very often found bugs in C code by renaming the source file to .cc, and using the C++ compiler as a lint tool. Even if you don't change a single line of code (well, other than conflicts with the very few new keywords, and other minor incompatibilities), you generally get a better program with C++, because it slipped a few less "quick ones" (like casting pointers around for you, or enums being really just ints).
If you use the standard library too to avoid rewriting the 324785124th implementation of a linked list (hmm, I wonder if which of the two is more likely to be buggy?), so much the better.
(
Log in to post comments)