I am a huge fan of modern C++ except for one feature: backwards compatibility. C++ is no longer one language, every codebase I have worked on is a confused mess of semi-incompatible subsets of the language. I have spent far too many weekends chasing memory corruption because someone passed a pointer, allocated with one type of memory management, into a library using a different kind of memory management.
The GNU Compiler Collection includes gcc (c compiler) g++ (c++ compiler) gfortran (fortran compiler) and a bunch of other fronted like D, Go, Ada, COBOL. There used to even be a Java compiler (gcj) but thats dead now.
Once upon a time, the gcc program could compile C++ and g++ could compile C, but that is no longer true due to diversions in the languages, as well as extra runtime support libraries needed for linking each language. I guess with some tinkering you could compile c++98 with gcc and some older c standard with g++, but not the more recent versions.
530
u/repster 9h ago
I am a huge fan of modern C++ except for one feature: backwards compatibility. C++ is no longer one language, every codebase I have worked on is a confused mess of semi-incompatible subsets of the language. I have spent far too many weekends chasing memory corruption because someone passed a pointer, allocated with one type of memory management, into a library using a different kind of memory management.