Defect Report #116
Submission Date: 03 Dec 93
Source: Ron Guilmette
ANSI/ISO C Defect Report #rfg23:
Subject: Implicit unary & applied to register arrays.
a) Does the following code involve usage which requires
a diagnostic from a conforming implementation?
b) Does the following code involve usage which renders the
code itself not strictly conforming?
void example ()
register int array = 0;
array; /* ? */
array; /* ? */
array+3; /* ? */
Subclause 6.5.1 (footnotes):
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 may not be computed, either explicitly (by
use of the unary & operator as discussed in 188.8.131.52) or implicitly
(by converting an array name to a pointer as discussed in
184.108.40.206). Thus the only operator that can be applied to an array
declared with storage-class specifier register is sizeof.
This footnote, while offering guidance, doesn't really answer the
question of whether or not an implementation is required to issue
a diagnostic for the case where the address of a register array is
implicitly taken (as discussed in subclause 220.127.116.11). Nor does it
definitively answer the question of whether such code should be considerd
to be strictly conforming or not.
(Reference: CIB #1,
RFI #17, question #6.)
a) No, a diagnostic is not required.
b) Yes, this renders the program not strictly
Previous Defect Report
< - >
Next Defect Report