1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-13 16:43:52 +01:00

CODING_CONVENTIONS: add more info about comment styles

This commit is contained in:
crasbe 2025-10-30 11:51:05 +01:00
parent 49b01c4284
commit a1ccbab35c

View File

@ -391,14 +391,33 @@ int timeout = TIMEOUT_INTERVAL * USEC_PER_SEC;
```
## Comments
* All comments should be written as C-style comments.
* Long multi-Line comments should have a leading asterisk for the second and
following lines. The first and last lines should be left empty and not contain
any comment text.
See also: [Linux Kernel Coding Style](https://www.kernel.org/doc/html/v4.10/process/coding-style.html#commenting).
* For short multi-line comments of two or three lines, a shorter style is
also permissible, where the first and last line do not need to be left empty.
E.g:
```c
/* This is a C-style comment */
/* This is a short
* multi-line comment (max 2-3 lines). */
/*
* This is a long multi-
* line comment for more
* than three lines of
* comment text.
*/
```
Wrong:
```c
// C++ comment here
/* This is a multi-line comment
without leading asterisk. */
```
## Documentation