Implement gcc bitfield algorithm; add -mms-bitfields

This commit is contained in:
David Mertens
2016-11-22 16:33:12 -05:00
parent 3c68a8c6c0
commit d2e2f42382
6 changed files with 44 additions and 7 deletions

View File

@ -1634,6 +1634,15 @@ void bitfield_test(void)
st2.f3 = a;
st2.f2++;
printf("%lld %lld %lld\n", st2.f1, st2.f2, st2.f3);
struct sbf3 {
int f1 : 7;
int f2 : 1;
char f3;
int f4 : 8;
int f5 : 1;
int f6 : 16;
} st3;
printf("sizeof(st3) = %d\n", sizeof(st3));
}
#ifdef __x86_64__