arocc
arocc copied to clipboard
Add diagnostic for taking address of packed record member
struct __attribute__((packed)) Foo {
int x;
};
struct Foo foo;
int *p = &foo.x;
test.c:5:11: warning: taking address of packed member 'x' of class or structure 'Foo' may result in an unaligned pointer value [-Waddress-of-packed-member]
This check can go in the same place as the addr_of_bitfield check.