Identifiants » Historique » Version 30
Patrice Nadeau, 2024-01-28 11:03
| 1 | 6 | Patrice Nadeau | # Objets |
|---|---|---|---|
| 2 | 3 | Patrice Nadeau | |
| 3 | ## Règles |
||
| 4 | |||
| 5 | 30 | Patrice Nadeau | 1. Nom |
| 6 | 1. Écris en **anglais** avec au maximum **31** caractères : |
||
| 7 | 1. Lettres minuscules |
||
| 8 | 1. Nombres |
||
| 9 | 1. Trait de soulignement |
||
| 10 | 1. Commence par une lettre |
||
| 11 | 1. Si plusieurs mots sont utilisés, ils sont séparées par des traits de soulignement |
||
| 12 | 1. Déclaration |
||
| 13 | 1. Un objet ayant une visibilité locale DOIT avoir le modificateur `static` dans sa déclaration |
||
| 14 | 1. Un objet « obsolète », DOIT avoir : |
||
| 15 | 1. Un des attributs suivants à sa déclaration : |
||
| 16 | 1. `deprecated` |
||
| 17 | 1. `unavailable` |
||
| 18 | 1. Les commentaires Doxygen suivants : |
||
| 19 | 1. `@deprecated` : Indications sur le remplacement à utiliser |
||
| 20 | 1. `@since` : Depuis quel version le changement est apparue |
||
| 21 | 1. Commentaires Doxygen suivants : |
||
| 22 | 19 | Patrice Nadeau | 1. `@brief` : Description obligatoire |
| 23 | 1. `@sa` : Lien vers une autre item (see also), facultatif |
||
| 24 | 29 | Patrice Nadeau | 1. `@todo` : Notes sur les tachés à faire, facultatif |
| 25 | 1. `@bug` : Notes sur les bogues présents, facultatif |
||
| 26 | 1. La gradations des notes et remarques se fait selon : |
||
| 27 | 28 | Patrice Nadeau | * `@remark` : Non importante |
| 28 | * `@note` : Général |
||
| 29 | * `@attention` : Important |
||
| 30 | 22 | Patrice Nadeau | * `@warning` : Conséquence négative |
| 31 | 30 | Patrice Nadeau | |
| 32 | 1 | Patrice Nadeau | |
| 33 | 3 | Patrice Nadeau | ## Exemple |
| 34 | 1 | Patrice Nadeau | ``` c |
| 35 | /** |
||
| 36 | 21 | Patrice Nadeau | * @brief old_function |
| 37 | 23 | Patrice Nadeau | * @deprecated Cette fonction seras retirée dans une prochaine version, 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 | * Embedded C Coding Standard : <https://barrgroup.com/embedded-systems/books/embedded-c-coding-standard> |
||
| 54 | 27 | Patrice Nadeau | * Génération de message lors de la compilation (`-Wall`) |