25 lines · c
1// RUN: %clang_analyze_cc1 -Wno-implicit-function-declaration -Wno-implicit-int -w -verify %s \2// RUN: -analyzer-checker=core \3// RUN: -analyzer-checker=unix.StdCLibraryFunctions4 5// expected-no-diagnostics6 7typedef ssize_t;8b;9 10unsigned c;11int write(int, const void *, unsigned long);12 13a() {14 d();15 while (c > 0) {16 b = write(0, d, c);17 if (b)18 c -= b;19 b < 1;20 }21 if (c && c) {22 // ^ no-crash23 }24}25