1 |
On 06/27/2010 09:10 PM, dev-random@××××.ru wrote: |
2 |
> On Sun, Jun 27, 2010 at 08:48:25PM +0300, Nikos Chantziaras wrote: |
3 |
>> ... |
4 |
>> It is allowed. Section 7.1.1, Paragraphs 2 and 3 of the C++ standard: |
5 |
>> ... |
6 |
> |
7 |
> Not in C. |
8 |
> ISO/IEC 9899:1999 (aka C99), section 6.7.1, note 101: |
9 |
>> The implementation may treat any register declaration simply as an auto |
10 |
>> declaration. However, whether or not addressable storage is actually |
11 |
>> used, the address of any part of an object declared with storage-class |
12 |
>> specifier register cannot be computed, either explicitly (by use of the |
13 |
>> unary& operator as discussed in 6.5.3.2) or implicitly (by converting |
14 |
>> an array name to a pointer as discussed in 6.3.2.1). Thus, the only |
15 |
>> operator that can be applied to an array declared with storage-class |
16 |
>> specifier register is sizeof. |
17 |
|
18 |
Wasn't aware of the difference here. But anyway, the warning is issued |
19 |
by GCC for C++ too, not just C. |