Identifiants » Historique » Version 40
Patrice Nadeau, 2025-03-23 10:43
| 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 | 40 | Patrice Nadeau | > Génération de message lors de la compilation (`-Wall`) |
| 15 | 32 | Patrice Nadeau | * `deprecated` |
| 16 | * `unavailable` |
||
| 17 | 33 | Patrice Nadeau | 1. Les commentaires Doxygen : |
| 18 | 32 | Patrice Nadeau | * `@deprecated` : Indications sur le remplacement à utiliser |
| 19 | * `@since` : Depuis quel version le changement est apparue |
||
| 20 | 35 | Patrice Nadeau | 1. Commentaires Doxygen : |
| 21 | 19 | Patrice Nadeau | 1. `@brief` : Description obligatoire |
| 22 | 1. `@sa` : Lien vers une autre item (see also), facultatif |
||
| 23 | 29 | Patrice Nadeau | 1. `@todo` : Notes sur les tachés à faire, facultatif |
| 24 | 1. `@bug` : Notes sur les bogues présents, facultatif |
||
| 25 | 1. La gradations des notes et remarques se fait selon : |
||
| 26 | 28 | Patrice Nadeau | * `@remark` : Non importante |
| 27 | * `@note` : Général |
||
| 28 | 22 | Patrice Nadeau | * `@attention` : Important |
| 29 | 30 | Patrice Nadeau | * `@warning` : Conséquence négative |
| 30 | 1 | Patrice Nadeau | |
| 31 | 3 | Patrice Nadeau | ## Exemple |
| 32 | 1 | Patrice Nadeau | ``` c |
| 33 | /** |
||
| 34 | 21 | Patrice Nadeau | * @brief old_function |
| 35 | 34 | Patrice Nadeau | * @deprecated Cette fonction seras retirée, utiliser new_function à la place |
| 36 | 1 | Patrice Nadeau | * @since Version x.x.xx |
| 37 | */ |
||
| 38 | 21 | Patrice Nadeau | int old_function(void) __attribute__((deprecated)); |
| 39 | 1 | Patrice Nadeau | |
| 40 | /** |
||
| 41 | 21 | Patrice Nadeau | * @brief old_function |
| 42 | 23 | Patrice Nadeau | * @deprecated Cette fonction est retirée, utiliser new_function à la place |
| 43 | 1 | Patrice Nadeau | * @since Version x.x.xx |
| 44 | */ |
||
| 45 | 21 | Patrice Nadeau | int old_function(void) __attribute__((unavailable)); |
| 46 | 1 | Patrice Nadeau | ``` |
| 47 | 5 | Patrice Nadeau | |
| 48 | ## Justification |
||
| 49 | * Linux kernel coding style : <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#naming> |
||
| 50 | * GNU Coding Standards <https://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C> |
||
| 51 | 27 | Patrice Nadeau | * Embedded C Coding Standard : <https://barrgroup.com/embedded-systems/books/embedded-c-coding-standard> |