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:
Vassil Vassilev 2013-08-02 17:09:50 +02:00 committed by sftnight
parent 9a362ba643
commit 9bb1eae342
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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