Identifiants » Historique » Version 39
Patrice Nadeau, 2025-03-23 10:41
1 | 36 | Patrice Nadeau | # Identifiants |
---|---|---|---|
2 | 3 | Patrice Nadeau | |
3 | 30 | Patrice Nadeau | 1. Nom |
4 | 38 | Patrice Nadeau | 1. En **anglais américain**, maximum de **31** caractères : |
5 | 30 | Patrice Nadeau | 1. Lettres minuscules |
6 | 1. Nombres |
||
7 | 1. Trait de soulignement |
||
8 | 1. Commence par une lettre |
||
9 | 37 | Patrice Nadeau | 1. Si plusieurs mots sont utilisés, ils DOIVENT être séparées par des traits de soulignement |
10 | 30 | Patrice Nadeau | 1. Déclaration |
11 | 31 | Patrice Nadeau | 1. Un objet ayant une visibilité locale DOIT avoir le modificateur `static` |
12 | 30 | Patrice Nadeau | 1. Un objet « obsolète », DOIT avoir : |
13 | 33 | Patrice Nadeau | 1. Un des attributs : |
14 | 32 | Patrice Nadeau | * `deprecated` |
15 | * `unavailable` |
||
16 | 33 | Patrice Nadeau | 1. Les commentaires Doxygen : |
17 | 32 | Patrice Nadeau | * `@deprecated` : Indications sur le remplacement à utiliser |
18 | * `@since` : Depuis quel version le changement est apparue |
||
19 | 35 | Patrice Nadeau | 1. Commentaires Doxygen : |
20 | 19 | Patrice Nadeau | 1. `@brief` : Description obligatoire |
21 | 1. `@sa` : Lien vers une autre item (see also), facultatif |
||
22 | 29 | Patrice Nadeau | 1. `@todo` : Notes sur les tachés à faire, facultatif |
23 | 1. `@bug` : Notes sur les bogues présents, facultatif |
||
24 | 1. La gradations des notes et remarques se fait selon : |
||
25 | 28 | Patrice Nadeau | * `@remark` : Non importante |
26 | * `@note` : Général |
||
27 | 22 | Patrice Nadeau | * `@attention` : Important |
28 | 30 | Patrice Nadeau | * `@warning` : Conséquence négative |
29 | 1 | Patrice Nadeau | |
30 | 3 | Patrice Nadeau | ## Exemple |
31 | 1 | Patrice Nadeau | ``` c |
32 | /** |
||
33 | 21 | Patrice Nadeau | * @brief old_function |
34 | 34 | Patrice Nadeau | * @deprecated Cette fonction seras retirée, utiliser new_function à la place |
35 | 1 | Patrice Nadeau | * @since Version x.x.xx |
36 | */ |
||
37 | 21 | Patrice Nadeau | int old_function(void) __attribute__((deprecated)); |
38 | 1 | Patrice Nadeau | |
39 | /** |
||
40 | 21 | Patrice Nadeau | * @brief old_function |
41 | 23 | Patrice Nadeau | * @deprecated Cette fonction est retirée, utiliser new_function à la place |
42 | 1 | Patrice Nadeau | * @since Version x.x.xx |
43 | */ |
||
44 | 21 | Patrice Nadeau | int old_function(void) __attribute__((unavailable)); |
45 | 1 | Patrice Nadeau | ``` |
46 | 5 | Patrice Nadeau | |
47 | ## Justification |
||
48 | * Linux kernel coding style : <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#naming> |
||
49 | * GNU Coding Standards <https://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C> |
||
50 | * Embedded C Coding Standard : <https://barrgroup.com/embedded-systems/books/embedded-c-coding-standard> |
||
51 | 27 | Patrice Nadeau | * Génération de message lors de la compilation (`-Wall`) |