History

Remove a bit-field TODO

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.

Michael Matz committed 9 years ago

Commit f775d681 parent 28084423 files · +9 −1Browse files

Unified · Split

3 files
  1. TODO +0 −1
  2. tccgen.c +2 −0
  3. tests/tcctest.c +7 −0
TODO+0−1
@@ -13,7 +13,6 @@ Bugs: · 12 unmodified lines
1313 - transform functions to function pointers in function parameters
1414 (net/ipv4/ip_output.c)
1515 - fix function pointer type display
16−- check lcc test suite -> fix bitfield binary operations
1716 - check section alignment in C
1817 - fix invalid cast in comparison 'if (v == (int8_t)v)'
1918 - finish varargs.h support (gcc 3.2 testsuite issue)
tccgen.c+2−0
@@ -6075,6 +6075,8 @@ static void decl_designator(CType *type, Section *sec, unsigned long c, · 6074 unmodified lines
60756075 c += index * type_size(type, &align);
60766076 } else {
60776077 f = *cur_field;
6078+ while (f && (f->v & SYM_FIRST_ANOM))
6079+ *cur_field = f = f->next;
60786080 if (!f)
60796081 tcc_error("too many field init");
60806082 /* XXX: fix this mess by using explicit storage field */
tests/tcctest.c+7−0
@@ -2075,6 +2075,13 @@ void bitfield_test(void) · 2074 unmodified lines
20752075 } st4;
20762076 st4.y = 1;
20772077 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);
20782085 }
20792086
20802087 #ifdef __x86_64__

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t