tic to provide a fixit suggesting
>>>>>>>> using
>>>>>>>> an anonymous bit-field to insert padding?
>>>>>>>>
>>>>>>>
>>>>>>> Isn't the Right Fix (tm) to make bool bitfields 1 wide and
t; It depends; maybe the intent is to be compatible with some on-disk
>>>>> format, and the explicit padding is important:
>>>>>
>>>>> struct X {
>>>>> int n : 3;
>>>>> bool b :
anonymous
>>>> bit-field would change the struct layout.
>>>>
>>>>
>>>>> On Mon, Sep 14, 2015 at 11:06 PM, Richard Smith <rich...@metafoo.co.uk
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> On Mon,
, it seems that the correct way to validate
>>>>>> the width of a bit-field (ignoring the special case of MS in C mode)
>>>>>> would
>>>>>> be to use getIntWidth in C mode, and getTypeSize in C++ mode.
>>>>>>
>>>>>> I wou
t;>>>>> bit-field may exceed the number of bits in the *object
>>>>>>> representation* (which includes padding bits) of the specified
>>>>>>> type, the extra bits will not take any part in the bit-field's *value
>>>>>>> repres
t;>>>
>>>>>>>> As of 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 correc
tTypeSize 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,
>>>&
M---On Mon, Sep 14, 2015 at 5:28 PM, Richard Smith <richard@metafo]Nico
>>>> Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard
>>>> Smith <rich...@metafoo.co.uk> wrote:
>>>>
>>>> From: Nico Weber <tha...@chromiu
r ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard
>>> Smith <rich...@metafoo.co.uk> wrote:
>>>
>>> From: Nico Weber <tha...@chromium.org>
>>> To: Richard Smith <rich...@metafoo.co.uk>
>>> Cc: Rachel Craik/Toronto/IBM@IBM
Nico
>> Weber ---09/14/2015 09:53:25 PM---On Mon, Sep 14, 2015 at 5:28 PM, Richard
>> Smith <rich...@metafoo.co.uk> wrote:
>>
>> From: Nico Weber <tha...@chromium.org>
>> To: Richard Smith <rich...@metafoo.co.uk>
Author: rcraik
Date: Mon Sep 14 16:27:36 2015
New Revision: 247618
URL: http://llvm.org/viewvc/llvm-project?rev=247618=rev
Log:
C11 _Bool bitfield diagnostic
Summary: Implement DR262 (for C). This patch will mainly affect bitfields of
type _Bool
Reviewers: fraggamuffin, rsmith
Subscribers:
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
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,
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,
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:
>>
>>>
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
16 matches
Mail list logo