mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-13 08:33:49 +01:00
CODING_CONVENTIONS: add more info about comment styles
This commit is contained in:
parent
49b01c4284
commit
a1ccbab35c
@ -391,14 +391,33 @@ int timeout = TIMEOUT_INTERVAL * USEC_PER_SEC;
|
|||||||
```
|
```
|
||||||
## Comments
|
## Comments
|
||||||
* All comments should be written as C-style 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:
|
E.g:
|
||||||
```c
|
```c
|
||||||
/* This is a C-style comment */
|
/* 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:
|
Wrong:
|
||||||
```c
|
```c
|
||||||
// C++ comment here
|
// C++ comment here
|
||||||
|
|
||||||
|
/* This is a multi-line comment
|
||||||
|
without leading asterisk. */
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user