This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help with bit-field semantics in C and C++


Joe Buck <Joe.Buck@synopsys.COM> writes:

| On Wed, Aug 25, 2004 at 02:24:19AM +0200, Gabriel Dos Reis wrote:
| > I believe the issue is whether the value actually stored in the enum
| > object should be 7. That is where I was understanding "permitted"
| > being used.
| 
| All compilers from GNU, Sun, and HP appear to happily store the 7.

The compatibility annexe (D) of the C++ standards documents that

  C++ objects of enumeration type can only be assigned values of the
  same enumeration type. In C, objects of enumeration type can be
  assigned values of any integral type 

  Effect on original feature: Deletion of semantically well-defined
  feature. 
  Difficulty of converting: Syntactic transformation. (The type error
  produced by the assignment can be automatically corrected by
  applying an explicit cast.) 
  How widely used: Common.

I don't have my copy of ARM handy here to check for more elaboration.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]