165Fermer167
Kevin KoflerLe 12/10/2007 à 18:14
Le standard ISO C99 dit ça:
4 A declaration of an identifier for an object with storage-class specifier register suggests that access to the object be as fast as possible. The extent to which such suggestions are effective is implementation-defined.100)

100) The implementation may treat any register declaration simply as an auto declaration. However, whether or not addressable storage is actually used, the address of any part of an object declared with storage-class specifier register cannot be computed, either explicitly (by use of the unary & operator as discussed in 6.5.3.2) or implicitly (by converting an array name to a pointer as discussed in 6.3.2.1). Thus, the only operator that can be applied to an array declared with storage-class specifier register is sizeof.

Et GCC implémente exactement la note 100. L'allocation de registres décide automatiquement ce qui va dans un registre et ce qui n'y va pas.