lang:c:syntaxe:attribute
Ceci est une ancienne révision du document !
__attribute__((const)) vs __attribute__((pure))
Many functions have no effects except the return value and their return value depends only on the parameters and/or global variables
Many functions do not examine any values except their arguments, and have no effects except the return value.Using the GNU Compiler Collection, Archive
Les deux n'ont pas le droit de modifier quoi que ce soit en dehors de la fonction.
pure
a accès aux arguments et aux variables globales et peut déréférencer à pointeur alors que const
n'a accès qu'aux arguments et ne peut pas déréférencer un pointeur.
lang/c/syntaxe/attribute.1498947729.txt.gz · Dernière modification : 2017/07/02 00:22 de root