On 3/16/21, Gregory Nutt <spudan...@gmail.com> wrote: > >>> I had to change my file names, from cpp to cxx. Is it mandatory to >>> change the file extension to use C++? >>> >> No, .cxx is just the default extension. You can change the default value >> in >> Makefile like this: >> CXXEXT=.cpp >> But this feature just exists in Makefile under the apps folder. > > Again, the coding standard does currently require the .cxx extension: > https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#cplusplus > > I would consider that up for discussion and subject to community > concurrence. Which ever is selected, the extension should be used > consistently. All C++ files under apps follow the coding standard for > file naming EXCEPT for some ELF loadable modules and some test-releated > files that are currently in violation of the coding standard: > > ./examples/elf/tests/helloxx/hello++1.cpp > ./examples/elf/tests/helloxx/hello++2.cpp > ./examples/elf/tests/helloxx/hello++3.cpp > ./examples/elf/tests/helloxx/hello++4.cpp > ./examples/elf/tests/helloxx/hello++5.cpp > ./examples/nxflat/tests/hello++/hello++1.cpp > ./examples/nxflat/tests/hello++/hello++2.cpp > ./examples/nxflat/tests/hello++/hello++3.cpp > ./examples/nxflat/tests/hello++/hello++4.cpp > ./testing/irtest/cmd.cpp > ./testing/irtest/enum.cpp > ./testing/irtest/main.cpp > > We do require strong motivation before any changes are made to the > coding stardard. We want to avoid the case where the coding standard is > changed to meet the preferences a single person or a single > organization. Any changes must have a broad community mandate. >
I found a small discussion here: https://forums.codeguru.com/showthread.php?397010-What-s-with-*-cxx-files-instead-of-*-cpp In general: cpp is from Windows side and .cxx is from Unix side. I think we are in the Unix side! :-) The .cpp extension is more known, but it could be confused with the C or C++ Pre-Processor extension. BR, Alan