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