We check whether there is terminal attached and if not (as the case of the testsuite) we don't need to answer the warning.
This commit is contained in:
parent
9a362ba643
commit
9bb1eae342
@ -3,12 +3,12 @@
|
||||
int *p;
|
||||
int x;
|
||||
x = *p; // expected-warning {{you are about to dereference null ptr, which probably will lead to seg violation. Do you want to proceed?[y/n]}}
|
||||
n
|
||||
|
||||
extern "C" int printf(const char* fmt, ...);
|
||||
class MyClass {
|
||||
public:
|
||||
int a;
|
||||
};
|
||||
MyClass *m = 0;
|
||||
if (m->a) { printf("MyClass's a=%d", m->a);} // expected-warning {{you are about to dereference null ptr, which probably will lead to seg violation. Do you want to proceed?[y/n]}}
|
||||
n
|
||||
.q
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
//This file checks a pointer store operation for null ptr dereference.
|
||||
int *p;
|
||||
*p = 6;
|
||||
n
|
||||
*p = 6; // expected-warning {{you are about to dereference null ptr, which probably will lead to seg violation. Do you want to proceed?[y/n]}}
|
||||
.q
|
||||
|
Loading…
x
Reference in New Issue
Block a user