4 ms·
Why do people use .cpp for files and yet CXXFLAGS for makefiles, anyway? (also see .cc, but almost never .cxx)
by byuu 12y ago
Why do people use .cpp for files and yet CXXFLAGS for makefiles, anyway? (also see .cc, but almost never .cxx)
- quesera 12y agoCPP in CPPFLAGS means "C PreProcessor", and pre-dates C++. This collision is why CXXFLAGS was chosen for C++ compile-time flags. ('+' being an inconvenient literal to use in a shell environment.) The .cpp extension comes from platforms where CPPFLAGS didn't exist, i.e. not UNIX. I think .cc has always been preferred on UNIX platforms, though .C used to be common as well.
- kazinator 12y agoYou wouldn't see .cxx because why would anyone use that suffix if they could simply make it .c++, right? The XX glyphs are the closest thing to the + glyph that can be used in a shell or make variable name.