Wiki » Historique » Version 182
Patrice Nadeau, 2026-01-18 19:57
| 1 | 1 | Patrice Nadeau | # Règles de codage C |
|---|---|---|---|
| 2 | |||
| 3 | 175 | Patrice Nadeau | Le langage C utilisé avec le compilateur GCC : |
| 4 | 178 | Patrice Nadeau | * Standard [C99](https://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf) (`-std=c99`) |
| 5 | 177 | Patrice Nadeau | * Extensions GNU |
| 6 | 179 | Patrice Nadeau | * **__attribute__((deprecated))** (`-Wdeprecated-declaration`) |
| 7 | * **__attribute__((noreturn))** |
||
| 8 | 181 | Patrice Nadeau | * **#pragma GCC message ""** |
| 9 | * **#pragma GCC warning ""** |
||
| 10 | * **#pragma GCC error ""** |
||
| 11 | 1 | Patrice Nadeau | |
| 12 | --- |
||
| 13 | 182 | Patrice Nadeau | ## Identifiants |
| 14 | 1. Ne DOIT PAS contenir plus de **31** caractères |
||
| 15 | > ANSI standards |
||
| 16 | * a @ z |
||
| 17 | * A @ Z |
||
| 18 | * 0 @ 9 |
||
| 19 | * Trait de soulignement (__) |
||
| 20 | 173 | Patrice Nadeau | |
| 21 | [[Fichiers]] |
||
| 22 | 154 | Patrice Nadeau | |
| 23 | 162 | Patrice Nadeau | [[Style]] |
| 24 | 1 | Patrice Nadeau | |
| 25 | 182 | Patrice Nadeau | ##Commentaires |
| 26 | 1. Précède l’élément à documenté, avec la même indentation |
||
| 27 | 1. En minuscules et commence par une majuscule |
||
| 28 | 1. Phrase complète en français |
||
| 29 | 1. Sur une ou plusieurs lignes |
||
| 30 | 1. De style |
||
| 31 | * C (/*... */) : Commentaires du code |
||
| 32 | * Javadoc (/** */, @) : Commentaires devant apparaître dans la documentation (Doxygen) |
||
| 33 | > La documentation est partie intégrante du code |
||
| 34 | 1. Les « décorations » (gras, italique, etc.) sont faites avec la syntaxe Markdown |
||
| 35 | * Italique : `∗` ou `_` |
||
| 36 | * Gras : `∗∗` ou `__` |
||
| 37 | 1. Les commentaires suivants peuvent aussi être utilisés |
||
| 38 | * `@todo` |
||
| 39 | * `@bug` |
||
| 40 | 82 | Patrice Nadeau | |
| 41 | 169 | Patrice Nadeau | [[Identifiants]] |
| 42 | 163 | Patrice Nadeau | |
| 43 | 168 | Patrice Nadeau | [[Macros et préprocesseur]] |
| 44 | 162 | Patrice Nadeau | |
| 45 | [[Énumérations]] |
||
| 46 | |||
| 47 | [[Typedef]] |
||
| 48 | |||
| 49 | [[Variables]] |
||
| 50 | |||
| 51 | [[Structures]] |
||
| 52 | |||
| 53 | [[Fonctions]] |
||
| 54 | |||
| 55 | [[Librairies]] |
||
| 56 | 1 | Patrice Nadeau | |
| 57 | 159 | Patrice Nadeau | [[Atmel AVR]] |