This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch - gcc-4.0 not c99 conforming when assigning scalar values to boolean bitfields
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Geoffrey Keating <geoffk at geoffk dot org>
- Cc: Fariborz Jahanian <fjahanian at apple dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 31 Mar 2005 23:09:18 +0000 (UTC)
- Subject: Re: patch - gcc-4.0 not c99 conforming when assigning scalar values to boolean bitfields
- References: <26E1AC94-A231-11D9-B8B3-000393B9ED88@apple.com> <m2vf77h1u4.fsf@greed.local>
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)