-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Unify C++ source and header file extensions #44196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please feel free to update this issue with more contexts and opinions. |
I would suggest the |
|
I also prefer By the way, the scope of this is the files that are being committed to the main Zephyr repository (i.e. zephyrproject-rtos/zephyr) only. Third-party code in the modules can keep whatever convention their upstream repo uses. |
+1 for .cpp .hpp |
Another vote for |
In my experience |
I also vote for .hpp / .cpp. Make sure that you also add a compliance check that fails all the others so we don't forget we made this decision. |
Rename all .cc files to .cpp (note that no .hh files were found). Addresses zephyrproject-rtos#44196 Signed-off-by: Yuval Peress <[email protected]>
Rename all .cc files to .cpp (note that no .hh files were found). Addresses #44196 Signed-off-by: Yuval Peress <[email protected]>
Hi @stephanosio, This issue, marked as an RFC, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise. Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason. Thanks! |
Overview
Currently, we have different file extensions for the C++ source and header files in the Zephyr repository:
Source Files
cpp
cxx
cc
Header Files
h
hh
For the sake of consistency, the project should decide on and use only single extension each for the C++ source and header files.
Context
Widely-used conventions
C++ source Files:
.cpp
,.cxx
,.cc
,C
C++ header Files:
.hpp
,.hxx
,.hh
,h
From the perspective of the Standard C++ Foundation
Opinions
Amongst the "widely-used conventions" listed above, some to avoid are:
C
(capital C) for source filesh
for C++ header filesProposed Change
.cpp
for C++ source files..hpp
for C++ header files.The text was updated successfully, but these errors were encountered: