arocc icon indicating copy to clipboard operation
arocc copied to clipboard

Disallow address-of bitfield

Open ehaas opened this issue 3 years ago • 0 comments

struct S {
    int x: 4;
};

void foo(void) {
    struct S s;
    (void)&s.x;
}

clang output:

test.c:7:11: error: address of bit-field requested
    (void)&s.x;
          ^~~~

ehaas avatar Aug 08 '22 16:08 ehaas