Debian Codegraph @

clang/test/Analysis/override-werror.c

raw
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -verify
2 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -Werror %s -analyzer-werror -verify=werror
3
4 // This test case illustrates that using '-analyze' overrides the effect of
5 // -Werror. This allows basic warnings not to interfere with producing
6 // analyzer results.
7
8 void f(int *p) {
9 int; // expected-warning{{declaration does not declare anything}} \
10 werror-warning{{declaration does not declare anything}}
11 }
12
13 void g(int *p) {
14 if (!p) *p = 0; // expected-warning{{null}} \
15 werror-error{{null}}
16 }
17