Checked the lcc testsuite for bitfield stuff (in cq.c and fields.c), fixed one more error in initializing unnamed members (which have to be skipped), removed the TODO.
Unified · Split
| @@ -13,7 +13,6 @@ Bugs: · 12 unmodified lines | ||
| 13 | 13 | - transform functions to function pointers in function parameters |
| 14 | 14 | (net/ipv4/ip_output.c) |
| 15 | 15 | - fix function pointer type display |
| 16 | −- check lcc test suite -> fix bitfield binary operations | |
| 17 | 16 | - check section alignment in C |
| 18 | 17 | - fix invalid cast in comparison 'if (v == (int8_t)v)' |
| 19 | 18 | - finish varargs.h support (gcc 3.2 testsuite issue) |
| @@ -6075,6 +6075,8 @@ static void decl_designator(CType *type, Section *sec, unsigned long c, · 6074 unmodified lines | ||
| 6075 | 6075 | c += index * type_size(type, &align); |
| 6076 | 6076 | } else { |
| 6077 | 6077 | f = *cur_field; |
| 6078 | + while (f && (f->v & SYM_FIRST_ANOM)) | |
| 6079 | + *cur_field = f = f->next; | |
| 6078 | 6080 | if (!f) |
| 6079 | 6081 | tcc_error("too many field init"); |
| 6080 | 6082 | /* XXX: fix this mess by using explicit storage field */ |
| @@ -2075,6 +2075,13 @@ void bitfield_test(void) · 2074 unmodified lines | ||
| 2075 | 2075 | } st4; |
| 2076 | 2076 | st4.y = 1; |
| 2077 | 2077 | printf("st4.y == %d\n", st4.y); |
| 2078 | + struct sbf5 { | |
| 2079 | + int a; | |
| 2080 | + char b; | |
| 2081 | + int x : 12, y : 4, : 0, : 4, z : 3; | |
| 2082 | + char c; | |
| 2083 | + } st5 = { 1, 2, 3, 4, -3, 6 }; | |
| 2084 | + printf("st5 = %d %d %d %d %d %d\n", st5.a, st5.b, st5.x, st5.y, st5.z, st5.c); | |
| 2078 | 2085 | } |
| 2079 | 2086 | |
| 2080 | 2087 | #ifdef __x86_64__ |