Debian Codegraph @

rts/c/STYLE.md

raw
1 Coding Style for Futhark C Runtime Component
2 ==
3
4 * Use two spaces for indentation, no tabs.
5
6 * Try to stay below 80 characters per line.
7
8 * Braces are mandatory for control flow structures.
9
10 * Use only line comments.
11
12 * Use snake_case for naming, except preprocessor macros, which are
13 uppercase.
14
15 * Check all return values.
16
17 * Do not use header guards, and do not include one RTS header from
18 another. The header files here are not intended to be used as
19 normal C header files, but are instead copied into the generated
20 program in a specific order. An argument could be made that perhaps
21 they ought be `.c` files instead.
22
23 * Start all files with the comment `// Start of foo.h.` and end with
24 `// End of foo.h.`. This makes the concatenated code easier to
25 navigate.
26
27 * Ensure, as far as possible, that the code is also valid C++.