need help to redefine packed c struct in d

Dakota dakota at gmail.com
Sat Sep 28 07:54:40 UTC 2024


```c
struct __attribute__((packed)) type1 {
     uint32_t        u32;
     uint8_t         u8;
     uint16_t        u16a;
     uint16_t        u16b;
     uint8_t         u8a;
     uint8_t         arr[14];
};

```

the struct size in C is 24:

I try `pragma(packed)` and `align(1):`, the d size always is 25.

how to fix this?


More information about the Digitalmars-d-learn mailing list