1
Vote

Support _(unchecked) for bit-field operations

description

Currently there is no support for unchecked operations on bit fields.
Would be nice to have.

typedef unsigned UINT32;
typedef struct A {
struct
{
    UINT32 f : 2;
    UINT32 : 30;
};
_(backing_member)
UINT32 AsUINT64;
} A;

void foo(UINT32 b)
_(requires b <= 3)
{
A a;
a.f = _(unchecked)(b + 1); // not supported
}

comments

stobies wrote May 10, 2012 at 7:19 PM

Will be supported by marking the entire assignment as unchecked