We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 932599e commit ad373abCopy full SHA for ad373ab
regression/cbmc/compound_literal1/main.c
@@ -6,6 +6,8 @@ union U { float f; int i; };
6
// global scope, static lifetime
7
int *global_scope_literal=&(int){ 43 };
8
9
+int array[3] = (int[3]){1, 2, 3};
10
+
11
int main()
12
{
13
assert(*global_scope_literal==43);
src/ansi-c/c_typecheck_initializer.cpp
@@ -38,7 +38,9 @@ void c_typecheck_baset::do_initializer(
38
"any array must have a size");
39
40
// we don't allow initialisation with symbols of array type
41
- if(result.id() != ID_array && result.id() != ID_array_of)
+ if(
42
+ result.id() != ID_array && result.id() != ID_array_of &&
43
+ result.id() != ID_compound_literal)
44
45
error().source_location = result.source_location();
46
error() << "invalid array initializer " << to_string(result)
0 commit comments