gt; padding bits, or we don't.
>>>
>>
>> Yup, makes sense.
>>
>>
>>>
>>>
>>>> , but it doesn't seem likely they got that effect. Would you be more
>>>>>>>> convinced if we amended the diagnostic to provide a
insert padding?
>>>>>>>
>>>>>>
>>>>>> Isn't the Right Fix (tm) to make bool bitfields 1 wide and rely on
>>>>>> the compiler to figure out padding?
>>>>>>
>>>>>
&
padding is important:
>>>>
>>>> struct X {
>>>> int n : 3;
>>>> bool b : 3;
>>>> int n : 2;
>>>> };
>>>>
>>>> Changing the bool bit-field to 1 bit without inserting an anonymous
>>>> bi
DR262, the C standard clarified that the width of a bit-field
>>>>>>>> can not exceed that of the specified type, and this change was
>>>>>>>> primarily to
>>>>>>>> ensure that Clang correctly enforced this part of the stand
to
>>>>>>> ensure that Clang correctly enforced this part of the standard. Looking
>>>>>>> at
>>>>>>> the C++11 standard again, it states that although the specified width
>>>>>>> of a
>>>>>>> bit-fiel
;>>>>> representation* (which includes padding bits) of the specified type,
>>>>>> the extra bits will not take any part in the bit-field's *value
>>>>>> representation*.
>>
h in C mode, and getTypeSize in C++ mode.
>>>>>
>>>>> I would be happy create a patch to make this change tomorrow if people
>>>>> are in agreement.
>>>>>
>>>> David Majnemer has already landed a couple of changes to fix this up,
&g
ple of changes to fix this up, so
>>> hopefully that won't be necessary. Thanks for working on this!
>>>
>>>> Rachel
>>>>
>>>>
>>>> [image: Inactive hide details for Nico Weber ---09/14/2015 09:53:25
>>>> PM---On M
this!
>>
>>> Rachel
>>>
>>>
>>> [image: Inactive hide details for Nico Weber ---09/14/2015 09:53:25
>>> PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith >> Weber ---09/14/2015 09:53:25 PM---On Mon, Sep
Mon, Sep 14, 2015 at 5:28 PM, Richard
>> Smith wrote:
>>
>> From: Nico Weber
>> To: Richard Smith
>> Cc: Rachel Craik/Toronto/IBM@IBMCA, cfe-commits <
>> cfe-commits@lists.llvm.org>
>> Date: 09/14/2015 09:53 PM
>> Subject: Re: r247618 - C11 _Bool bitf
5:28 PM, Richard Smith Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard
> Smith wrote:
>
> From: Nico Weber
> To: Richard Smith
> Cc: Rachel Craik/Toronto/IBM@IBMCA, cfe-commits <
> cfe-commits@lists.llvm.org>
> Date: 09/14/
015 at 5:28 PM, Richard Smith Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard
> Smith wrote:
>
> From: Nico Weber
> To: Richard Smith
> Cc: Rachel Craik/Toronto/IBM@IBMCA, cfe-commits <
> cfe-commits@lists.llvm.org&g
, cfe-commits
Date: 09/14/2015 09:53 PM
Subject: Re: r247618 - C11 _Bool bitfield diagnostic
Sent by:tha...@google.com
On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith
wrote:
On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits <
cfe-commits@lists.llvm.or
On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith
wrote:
> On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> This also fires for bool in C++ files, even though the commit message
>> saying C11 and _Bool. Given the test changes, I suppose that's i
On Mon, Sep 14, 2015 at 6:10 PM, David Majnemer
wrote:
> On Mon, Sep 14, 2015 at 6:01 PM, Richard Smith
> wrote:
>
>> On Mon, Sep 14, 2015 at 5:55 PM, David Majnemer > > wrote:
>>
>>> On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith
>>> wrote:
>>>
On Mon, Sep 14, 2015 at 5:31 PM, David Majne
On Mon, Sep 14, 2015 at 6:01 PM, Richard Smith
wrote:
> On Mon, Sep 14, 2015 at 5:55 PM, David Majnemer
> wrote:
>
>> On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith
>> wrote:
>>
>>> On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer <
>>> david.majne...@gmail.com> wrote:
>>>
On Mon, Sep 14, 2
On Mon, Sep 14, 2015 at 5:55 PM, David Majnemer
wrote:
> On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith
> wrote:
>
>> On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer > > wrote:
>>
>>> On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits <
>>> cfe-commits@lists.llvm.org> wrote:
>>>
On Mon, Sep 14, 2015 at 5:40 PM, Richard Smith
wrote:
> On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer
> wrote:
>
>> On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits <
>>> cf
On Mon, Sep 14, 2015 at 5:31 PM, David Majnemer
wrote:
> On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> This also fires for bool i
On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith via cfe-commits <
cfe-commits@lists.llvm.org> wrote:
> On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> This also fires for bool in C++ files, even though the commit message
>> saying C11 and _Boo
On Mon, Sep 14, 2015 at 5:18 PM, Nico Weber via cfe-commits <
cfe-commits@lists.llvm.org> wrote:
> This also fires for bool in C++ files, even though the commit message
> saying C11 and _Bool. Given the test changes, I suppose that's intentional?
> This fires a lot on existing code, for example pr
It affects for targeting MS.
Tweaked one test in r247640. You can emulate to add -mms-bitfields.
On Tue, Sep 15, 2015 at 6:29 AM Rachel Craik via cfe-commits <
cfe-commits@lists.llvm.org> wrote:
> Author: rcraik
> Date: Mon Sep 14 16:27:36 2015
> New Revision: 247618
>
> URL: http://llvm.org/vie
This also fires for bool in C++ files, even though the commit message
saying C11 and _Bool. Given the test changes, I suppose that's intentional?
This fires a lot on existing code, for example protobuf:
../../third_party/protobuf/src/google/protobuf/extension_set.h:465:10:
error: width of bit-fiel
Author: rcraik
Date: Mon Sep 14 16:27:36 2015
New Revision: 247618
URL: http://llvm.org/viewvc/llvm-project?rev=247618&view=rev
Log:
C11 _Bool bitfield diagnostic
Summary: Implement DR262 (for C). This patch will mainly affect bitfields of
type _Bool
Reviewers: fraggamuffin, rsmith
Subscribers
24 matches
Mail list logo