On Wednesday, 3 July 2024 at 21:47:32 UTC, Tim wrote:
If you only want to see the layout, you can use the following
command to dump it:
```
clang test.c -Xclang -fdump-record-layouts -c
```
File test.c could contain the following:
```
struct S
{
int a : 3;
int b : 29;
};
struct S dummy;
On Tuesday, 2 July 2024 at 05:34:19 UTC, Dakota wrote:
I want to get `bitoffsetof` and `bitwidth` in clang, to verify
the d memory layout.
I try this but not work:
```c
#define offsetof_bit(type, member) ((offsetof(type, member) *
8) + __builtin_ctz(((type *)0)->member))
```
get this error