blob: 6d8c65814b7afd1cab6c9dd22b57829742a38d37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// RUN: %clang_analyze_cc1 -Wno-implicit-function-declaration -Wno-implicit-int -w -verify %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctions
// expected-no-diagnostics
typedef ssize_t;
b;
unsigned c;
int write(int, const void *, unsigned long);
a() {
d();
while (c > 0) {
b = write(0, d, c);
if (b)
c -= b;
b < 1;
}
if (c && c) {
// ^ no-crash
}
}
|