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