Identifiants » Historique » Version 23
Patrice Nadeau, 2024-01-28 10:43
| 1 | 6 | Patrice Nadeau | # Objets |
|---|---|---|---|
| 2 | 3 | Patrice Nadeau | |
| 3 | ## Règles |
||
| 4 | |||
| 5 | 20 | Patrice Nadeau | 1. Écris en anglais avec au maximum **31** caractères : |
| 6 | 2 | Patrice Nadeau | 1. Lettres minuscules |
| 7 | 1. Nombres |
||
| 8 | 1. Trait de soulignement |
||
| 9 | 1 | Patrice Nadeau | 1. Si plusieurs mots sont utilisés, ils sont séparées par des traits de soulignement |
| 10 | 18 | Patrice Nadeau | 1. Les commentaires Doxygen suivants sont ajoutés |
| 11 | 19 | Patrice Nadeau | 1. `@brief` : Description obligatoire |
| 12 | 1. `@sa` : Lien vers une autre item (see also), facultatif |
||
| 13 | 1. `@todo` : Notes sur les tachés à faire, facultatif |
||
| 14 | 1. `@bug` : Notes sur les bogues présents, facultatif |
||
| 15 | 1. La gradations des notes et remarques se fait selon : |
||
| 16 | * `@remark` : Non importante |
||
| 17 | * `@note` : Général |
||
| 18 | * `@attention` : Important |
||
| 19 | * `@warning` : Conséquence négative |
||
| 20 | 18 | Patrice Nadeau | 1. Le modificateur `static` pour les objets ayant une visibilité locale |
| 21 | 2 | Patrice Nadeau | 1. Les objets ne devant plus être utilisés, DOIVENT générer un message lors de la compilation (`-Wall`) si un appel est effectué. |
| 22 | 1. Les attributs`deprecated` ou `unavailable` DOIVENT être ajoutés à la déclaration. |
||
| 23 | 7 | Patrice Nadeau | 1. Les commentaires Doxygen suivants doivent être ajoutés : |
| 24 | 22 | Patrice Nadeau | 1. `@deprecated` : Indications sur le remplacement à utiliser |
| 25 | 1. `@since` : Depuis quel version le changement est apparue |
||
| 26 | 1 | Patrice Nadeau | |
| 27 | 3 | Patrice Nadeau | ## Exemple |
| 28 | 1 | Patrice Nadeau | ``` c |
| 29 | /** |
||
| 30 | 21 | Patrice Nadeau | * @brief old_function |
| 31 | 23 | Patrice Nadeau | * @deprecated Cette fonction seras retirée dans une prochaine version, utiliser new_function à la place |
| 32 | 1 | Patrice Nadeau | * @since Version x.x.xx |
| 33 | */ |
||
| 34 | 21 | Patrice Nadeau | int old_function(void) __attribute__((deprecated)); |
| 35 | 1 | Patrice Nadeau | |
| 36 | /** |
||
| 37 | 21 | Patrice Nadeau | * @brief old_function |
| 38 | 23 | Patrice Nadeau | * @deprecated Cette fonction est retirée, utiliser new_function à la place |
| 39 | 1 | Patrice Nadeau | * @since Version x.x.xx |
| 40 | */ |
||
| 41 | 21 | Patrice Nadeau | int old_function(void) __attribute__((unavailable)); |
| 42 | 4 | Patrice Nadeau | |
| 43 | /** |
||
| 44 | * @brief MACRO1 |
||
| 45 | * @deprecated Utiliser NEWMACRO à la place |
||
| 46 | 1 | Patrice Nadeau | * @since Version x.x.xx |
| 47 | */ |
||
| 48 | #define MACRO1 43 |
||
| 49 | #pragma GCC poison MACRO1 |
||
| 50 | 14 | Patrice Nadeau | |
| 51 | /** |
||
| 52 | * @brief Fonction locale |
||
| 53 | * @return Une valeur |
||
| 54 | */ |
||
| 55 | static int local_func(void) { |
||
| 56 | ... |
||
| 57 | return 0; |
||
| 58 | } |
||
| 59 | 1 | Patrice Nadeau | ``` |
| 60 | 5 | Patrice Nadeau | |
| 61 | ## Justification |
||
| 62 | * Linux kernel coding style : <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#naming> |
||
| 63 | * GNU Coding Standards <https://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C> |
||
| 64 | * Embedded C Coding Standard : <https://barrgroup.com/embedded-systems/books/embedded-c-coding-standard> |