Skip to content

Commit 39253b4

Browse files
committed
Use extern to declare an array
1 parent df63943 commit 39253b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/test/Analysis/out-of-bounds-constraint-check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void clang_analyzer_value(int);
99

1010
// Simple case: memory area with a static extent.
1111

12-
int FiveInts[5] = {1, 2, 3, 4, 5};
12+
extern int FiveInts[5];
1313

1414
void int_plus_one(int len) {
1515
(void)FiveInts[len + 1]; // no-warning

clang/test/Analysis/out-of-bounds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-checker=core,security.ArrayBound -verify %s
1+
// RUN: %clang_analyze_cc1 -analyzer-checker=core,security.ArrayBound -verify %s
22

33
// Tests doing an out-of-bounds access after the end of an array using:
44
// - constant integer index

0 commit comments

Comments
 (0)