C/C++ Style Guide
Follow the language standard and compiler options declared by the project. Keep source, headers and tests in their established directories.
- Prefer clear interfaces, deterministic resource ownership and RAII in C++. Avoid undefined behavior, unchecked buffers and unnecessary global state.
- Use const-correctness and appropriate standard library types. Document ownership at C and external API boundaries.
- Keep CMake targets scoped; use target properties and dependencies rather than global flags.
- Follow clang-format and clang-tidy configuration where enabled.
#include <string>
std::string greeting(const std::string& name) {
return "Hello, " + name;
}
Build with the declared CMake configuration, run CTest and use optional static analysis and sanitizers where available.