This is the mail archive of the gcc-patches@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: patch - gcc-4.0 not c99 conforming when assigning scalar values to boolean bitfields


"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Thu, 31 Mar 2005, Geoffrey Keating wrote:
> 
> > I don't think this change is completely right.  What happens if 'f2'
> > has size 200?  I think your change would see that 32 < 200 and will
> > have no effect.
> 
> A _Bool bit-field wider than the number of bits in a _Bool is a constraint 
> violation.  (It would appear to be a GCC bug that CHAR_TYPE_SIZE rather 
> than BOOL_TYPE_SIZE is used in the test for this constraint for _Bool.  It 
> would appear to be a bug in C99 TC2 that by changing this constraint to 
> refer to the width of the type, bit-fields of _Bool can no longer have 
> width greater than 1 at all.)

Huh!  Yes, it does say that.  That would certainly solve this problem.

Do we want to simply do what TC2 says?  It's not like oversized _Bool
bitfields are very useful, and it'll save a DR...


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