fuhsnn / slimcc

C11 compiler with GNU extensions for x86-64 Linux, working towards C23
MIT License
34 stars 4 forks source link

Union size/alignment with bitfield member #21

Closed fuhsnn closed 11 months ago

fuhsnn commented 11 months ago
#include <stdio.h>
#include <stdint.h>
union S{
   int8_t a;
   int64_t:37;
};
int main(void){
  printf("%d,", sizeof(union S));
  printf("%d\n", _Alignof(union S));
  // expect 5,1; got 8,8
}