lang:c:syntaxe
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
lang:c:syntaxe [2020/03/06 20:41] – [__attribute__((const)) vs __attribute__((pure))] root | lang:c:syntaxe [2020/03/06 20:46] (Version actuelle) – [__attribute__((weak))] : déplacement dans la page "Attribut" root | ||
---|---|---|---|
Ligne 6: | Ligne 6: | ||
=====Attribute===== | =====Attribute===== | ||
- | ====__attribute__((const)) vs __attribute__((pure))==== | ||
- | Les fonctions '' | ||
- | '' | ||
- | '' | ||
- | |||
- | < | ||
- | |||
- | The const attribute prohibits a function from reading objects that affect its return value between successive invocations. | ||
- | |||
- | In general, since a function cannot distinguish data that might change from data that cannot, const functions should never take pointer or, in C++, reference arguments. | ||
- | |||
- | < | ||
- | |||
- | ====__attribute__((weak))==== | ||
- | Définir une variable (globale) ou une fonction avec un attribut '' | ||
- | |||
- | Il est aussi possible de définir un prototype ou la déclaration d'une variable '' | ||
- | |||
- | <code c> | ||
- | extern const unsigned char __attribute__((weak)) variable; // Numéro de l' | ||
- | |||
- | const unsigned char __attribute__((weak)) variable = 1; | ||
- | |||
- | const unsigned char variable = 2; | ||
- | </ | ||
=====Passage par référence d'un tableau dans une fonction===== | =====Passage par référence d'un tableau dans une fonction===== | ||
'' | '' |
lang/c/syntaxe.1583523664.txt.gz · Dernière modification : 2020/03/06 20:41 de root