Identifiants » Historique » Version 18
Patrice Nadeau, 2024-01-27 15:47
| 1 | 6 | Patrice Nadeau | # Objets |
|---|---|---|---|
| 2 | 3 | Patrice Nadeau | |
| 3 | ## Règles |
||
| 4 | |||
| 5 | 2 | Patrice Nadeau | 1. Comportent au maximum **31** caractères : |
| 6 | 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 | 17 | Patrice Nadeau | * `@brief` : Description obligatoire |
| 12 | * `@sa` : Lien vers une autre item (see also), facultatif |
||
| 13 | * `@todo` : Notes sur les tachés à faire, facultatif |
||
| 14 | * `@bug` : Notes sur les bogues présents, facultatif |
||
| 15 | 18 | Patrice Nadeau | 1. Le modificateur `static` pour les objets ayant une visibilité locale |
| 16 | 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é. |
| 17 | 1. Les attributs`deprecated` ou `unavailable` DOIVENT être ajoutés à la déclaration. |
||
| 18 | 7 | Patrice Nadeau | 1. Les commentaires Doxygen suivants doivent être ajoutés : |
| 19 | 1. `@deprecated` : |
||
| 20 | 1. `@since` : |
||
| 21 | 1 | Patrice Nadeau | |
| 22 | 3 | Patrice Nadeau | ## Exemple |
| 23 | 1 | Patrice Nadeau | ``` c |
| 24 | /** |
||
| 25 | * @brief OldFunction |
||
| 26 | * @deprecated Utiliser NewFunction à la place |
||
| 27 | * @since Version x.x.xx |
||
| 28 | */ |
||
| 29 | int OldFunction(void) __attribute__((deprecated)); |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @brief OldFunction |
||
| 33 | * @deprecated Utiliser NewFunction à la place |
||
| 34 | * @since Version x.x.xx |
||
| 35 | */ |
||
| 36 | int OldFunction(void) __attribute__((unavailable)); |
||
| 37 | 4 | Patrice Nadeau | |
| 38 | /** |
||
| 39 | * @brief MACRO1 |
||
| 40 | * @deprecated Utiliser NEWMACRO à la place |
||
| 41 | 1 | Patrice Nadeau | * @since Version x.x.xx |
| 42 | */ |
||
| 43 | #define MACRO1 43 |
||
| 44 | #pragma GCC poison MACRO1 |
||
| 45 | 14 | Patrice Nadeau | |
| 46 | /** |
||
| 47 | * @brief Fonction locale |
||
| 48 | * @return Une valeur |
||
| 49 | */ |
||
| 50 | static int local_func(void) { |
||
| 51 | ... |
||
| 52 | return 0; |
||
| 53 | } |
||
| 54 | 1 | Patrice Nadeau | ``` |
| 55 | 5 | Patrice Nadeau | |
| 56 | ## Justification |
||
| 57 | * Linux kernel coding style : <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#naming> |
||
| 58 | * GNU Coding Standards <https://www.gnu.org/prep/standards/html_node/Writing-C.html#Writing-C> |
||
| 59 | * Embedded C Coding Standard : <https://barrgroup.com/embedded-systems/books/embedded-c-coding-standard> |