xref: /minix3/external/bsd/llvm/dist/clang/test/Analysis/override-werror.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -Werror %s -analyzer-store=region -verify
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // This test case illustrates that using '-analyze' overrides the effect of
4*f4a2713aSLionel Sambuc // -Werror.  This allows basic warnings not to interfere with producing
5*f4a2713aSLionel Sambuc // analyzer results.
6*f4a2713aSLionel Sambuc 
f(int * p)7*f4a2713aSLionel Sambuc char* f(int *p) {
8*f4a2713aSLionel Sambuc   return p; // expected-warning{{incompatible pointer types}}
9*f4a2713aSLionel Sambuc }
10*f4a2713aSLionel Sambuc 
g(int * p)11*f4a2713aSLionel Sambuc void g(int *p) {
12*f4a2713aSLionel Sambuc   if (!p) *p = 0; // expected-warning{{null}}
13*f4a2713aSLionel Sambuc }
14*f4a2713aSLionel Sambuc 
15