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


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.)

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery 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]