From 92c8be3a36dff49f92e6cf94719a1750e4961538 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 21 Apr 2018 18:57:51 +0300 Subject: Initialization of anonymous bit-fields in structs For anonymous bit-fields in structs, carrier fields may be introduced which are not initialized since no default initializer are generated earlier. This cause the translation in C2C to throw an error since too few initializers are available. Example: struct s2 { int : 10; int a; int : 10; char b; int : 10; short c; int : 10; } s2 = { 42, 'a', 43 }; To work around this issue we need to generate a default inializer for every new member that does not have a translated member. Based on P#80, with more efficient algorithms. Bug 23362 --- test/regression/bitfields9.c | 1 + 1 file changed, 1 insertion(+) (limited to 'test/regression/bitfields9.c') diff --git a/test/regression/bitfields9.c b/test/regression/bitfields9.c index 54cc34ab..eef20168 100644 --- a/test/regression/bitfields9.c +++ b/test/regression/bitfields9.c @@ -11,6 +11,7 @@ struct t { unsigned int c: 16; _Bool d: 1; short e: 8; + int : 10; }; union u { -- cgit