Intrepid / upc-specification

Automatically exported from code.google.com/p/upc-specification
0 stars 1 forks source link

disallow & applied to shared bitfields #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Presently, section 6.4.4 reads:

6.4.4 Address operators

Semantics

1 When the unary & is applied to a shared structure element of type T, the 
result has type shared [] T *.

This issue proposes that this section be ammended to read:
"shared structure element of type T that is not a bitfield"

---
Questions:

Would it be more appropriate to state a constraint that & may not be applied to 
shared bitfields, and leave the current Semantics clause as is?

What does C99 say about applying & to bitfields, can we simply follow suit.

Original issue reported on code.google.com by gary.funck on 18 Jul 2012 at 9:32

GoogleCodeExporter commented 9 years ago
C99 disallows & applied to bit-fields.
Quote from the WG14/N1256 draft appears below.

6.5.3.2 Address and indirection operators

Constraints

 1 The operand of the unary & operator shall be either a function designator, the result of a
   [] or unary * operator, or an lvalue that designates an object that is not a bit-field and is
   not declared with the register storage-class specifier.

Original comment by phhargr...@lbl.gov on 18 Jul 2012 at 9:38

GoogleCodeExporter commented 9 years ago
Sounds like no change is required. 

Good candidate for inclusion in the rationale document.

Original comment by danbonachea on 3 Aug 2012 at 1:14