Skip to content

Commit e288906

Browse files
author
Daniel Kroening
authored
Merge pull request #4901 from tautschnig/array-of
C front-end: Permit array_of as array initializer
2 parents fef6d08 + 5ded04d commit e288906

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// array size greater than MAX_FLATTENED_ARRAY_SIZE
2+
static unsigned char buffer[10000] = {0};
3+
4+
int main()
5+
{
6+
__CPROVER_assert(buffer[0] == 0, "");
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring

src/ansi-c/c_typecheck_initializer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void c_typecheck_baset::do_initializer(
3737
"any array must have a size");
3838

3939
// we don't allow initialisation with symbols of array type
40-
if(result.id()!=ID_array)
40+
if(result.id() != ID_array && result.id() != ID_array_of)
4141
{
4242
error().source_location = result.source_location();
4343
error() << "invalid array initializer " << to_string(result)

0 commit comments

Comments
 (0)