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++


On Tue, 24 Aug 2004, Roger Sayle wrote:

> My apologies.  Joseph Myers and Mark Mitchell have already pointed
> out the I've used the wrong terminology.  The g++ front-end treats
> C++ enumerators as "bit-sized" integers.  These are not the same
> to language lawyers as bit-fields.  In the middle-end, however, they
> are treated similarly.

Note that the middle-end handling of bit-field types is restricted by a 
langhook and is only applied to integer types.  This is not entirely 
ideal, but was done as a pragmatic solution to get in a solution to 
long-standing much-reported C bugs in a finite time without adversely 
affecting other languages, since only C and ObjC deliberately use these 
types with their semantics and trees aren't *yet* precisely enough defined 
in this regard: other languages may generate types with narrower precision 
and mode without expecting the special handling (as possibly with C++ 
enums under discussion at present).  In future it may be possible to 
define trees more precisely so that what these types mean is clear in all 
circumstances, and remove the reduce_bit_field_operations langhook.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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