summaryrefslogtreecommitdiffhomepage
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md27
1 files changed, 20 insertions, 7 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 35934f8..d754f73 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -10,6 +10,8 @@ and nowhere else:
```sh
make # -> ./whoson
make check # under the CEE heap checker and storage report
+make format # clang-format -i whoson.c
+make tidy # clang-tidy, which needs the z/OS headers
make install # -> ~/.local/bin/whoson
```
@@ -34,17 +36,28 @@ syntax (`?=` is out), and let `make -n` stay free of side effects.
## Style
+`C-PROGRAMMING-STANDARDS.md` is the authority for language level, types,
+comments and the Makefile targets; this list is only what a change here has to
+remember.
+
- Warnings are bugs. The tree builds with `-Wall -Wextra -Wpedantic -Wshadow
- -Wconversion`; a warning from any of them, or from `clang-tidy` with
- `.clang-tidy`, gets fixed rather than silenced. `.clang-tidy` needs the z/OS
- headers (`<sys/ps.h>`), so only a z/OS build environment can run it; the
- Ubuntu CI job enforces clang-format, not clang-tidy.
+ -Wconversion -Wstrict-prototypes -Wmissing-prototypes`; a warning from any
+ of them, or from `clang-tidy` with `.clang-tidy`, gets fixed rather than
+ silenced. `.clang-tidy` needs the z/OS headers (`<sys/ps.h>`), so only a z/OS
+ build environment can run it, and IBM Open XL ships no clang-tidy: the only
+ one on the host is zopen's LLVM, which cannot compile z/OS `va_list`
+ (`__builtin_zos_va_start`). `make tidy` therefore reports those compiler
+ errors and nothing else; the Ubuntu CI job enforces clang-format.
+- C23: `nullptr` rather than `NULL`, `static_assert`, and `constexpr` for the
+ buffer and column widths. Compiler-only attributes go through a macro
+ (`PRINTFLIKE`).
- Types are `typedef struct name { ... } name;`, and no variable, function
or field reuses a type name.
-- `clang-format -i whoson.c` before committing; `.clang-format` is the
- authority, and CI checks the result against clang-format 23.1.5.
+- `make format` before committing; `.clang-format` is the authority, and CI
+ checks the result against clang-format 23.1.5.
- Comments say why, not what, and the file header says what the control-block
- walk and the process table give and what they do not.
+ walk and the process table give and what they do not. Functions, types and
+ globals carry a Doxygen `@brief`; struct members carry `/**< */`.
## Changes