Debian Codegraph @

clang/test/Analysis/weak-dependencies.c

raw
1 // RUN: %clang_analyze_cc1 %s -verify \
2 // RUN: -analyzer-checker=unix.StdCLibraryFunctions \
3 // RUN: -analyzer-checker=core
4
5 typedef __typeof(sizeof(int)) size_t;
6
7 struct FILE;
8 typedef struct FILE FILE;
9
10 size_t fread(void *restrict, size_t, size_t, FILE *restrict) __attribute__((nonnull(1)));
11
12 void f(FILE *F) {
13 int *p = 0;
14 fread(p, sizeof(int), 5, F); // expected-warning{{Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker]}}
15 }