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 18.104.22.168) or implicitly
(by converting an array name to a pointer as discussed in
22.214.171.124). 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 126.96.36.199). 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