Clean up obtuse wording of checker diagnostic of using an uninitialized value in a function call.

Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2010-09-09 22:51:55 +00:00
Родитель 80c60f7284
Коммит 818b433a94
7 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -193,7 +193,7 @@ void CallAndMessageChecker::PreVisitCallExpr(CheckerContext &C,
if (L.isUndef()) {
if (!BT_call_undef)
BT_call_undef =
new BuiltinBug("Called function pointer is an undefined pointer value");
new BuiltinBug("Called function pointer is an uninitalized pointer value");
EmitBadCall(BT_call_undef, C, CE);
return;
}
@ -208,8 +208,8 @@ void CallAndMessageChecker::PreVisitCallExpr(CheckerContext &C,
for (CallExpr::const_arg_iterator I = CE->arg_begin(), E = CE->arg_end();
I != E; ++I)
if (PreVisitProcessArg(C, *I,
"Pass-by-value argument in function call is"
" undefined", BT_call_arg))
"Function call argument is an uninitialized value",
BT_call_arg))
return;
}
@ -224,7 +224,7 @@ void CallAndMessageChecker::PreVisitObjCMessageExpr(CheckerContext &C,
if (ExplodedNode *N = C.GenerateSink()) {
if (!BT_msg_undef)
BT_msg_undef =
new BuiltinBug("Receiver in message expression is a garbage value");
new BuiltinBug("Receiver in message expression is an uninitialized value");
EnhancedBugReport *R =
new EnhancedBugReport(*BT_msg_undef, BT_msg_undef->getName(), N);
R->addRange(receiver->getSourceRange());
@ -239,8 +239,8 @@ void CallAndMessageChecker::PreVisitObjCMessageExpr(CheckerContext &C,
for (ObjCMessageExpr::const_arg_iterator I = ME->arg_begin(),
E = ME->arg_end(); I != E; ++I)
if (PreVisitProcessArg(C, *I,
"Pass-by-value argument in message expression "
"is undefined", BT_msg_arg))
"Argument in message expression "
"is an uninitialized value", BT_msg_arg))
return;
}

Просмотреть файл

@ -394,7 +394,7 @@ void rdar_7332673_test1() {
int rdar_7332673_test2_aux(char *x);
void rdar_7332673_test2() {
char *value;
if ( rdar_7332673_test2_aux(value) != 1 ) {} // expected-warning{{Pass-by-value argument in function call is undefined}}
if ( rdar_7332673_test2_aux(value) != 1 ) {} // expected-warning{{Function call argument is an uninitialized value}}
}
//===----------------------------------------------------------------------===//
@ -671,7 +671,7 @@ typedef void (^RDar_7462324_Callback)(id obj);
builder = ^(id object) {
id x;
if (object) {
builder(x); // expected-warning{{Pass-by-value argument in function call is undefined}}
builder(x); // expected-warning{{Function call argument is an uninitialized value}}
}
};
builder(target);

Просмотреть файл

@ -794,7 +794,7 @@ int test_uninit_branch_c(void) {
void test_bad_call_aux(int x);
void test_bad_call(void) {
int y;
test_bad_call_aux(y); // expected-warning{{Pass-by-value argument in function call is undefined}}
test_bad_call_aux(y); // expected-warning{{Function call argument is an uninitialized value}}
}
@interface TestBadArg {}
@ -803,7 +803,7 @@ void test_bad_call(void) {
void test_bad_msg(TestBadArg *p) {
int y;
[p testBadArg:y]; // expected-warning{{Pass-by-value argument in message expression is undefined}}
[p testBadArg:y]; // expected-warning{{Argument in message expression is an uninitialized value}}
}
//===----------------------------------------------------------------------===//

Просмотреть файл

@ -288,7 +288,7 @@ void pr4759_aux(int *p) __attribute__((nonnull));
void pr4759() {
int *p;
pr4759_aux(p); // expected-warning{{undefined}}
pr4759_aux(p); // expected-warning{{Function call argument is an uninitialized value}}
}

Просмотреть файл

@ -42,7 +42,7 @@ extern NSString * const NSUndoManagerCheckpointNotification;
unsigned f1() {
NSString *aString;
return [aString length]; // expected-warning {{Receiver in message expression is a garbage value}}
return [aString length]; // expected-warning {{Receiver in message expression is an uninitialized value}}
}
unsigned f2() {
@ -53,5 +53,5 @@ unsigned f2() {
void f3() {
NSMutableArray *aArray = [NSArray array];
NSString *aString;
[aArray addObject:aString]; // expected-warning {{Pass-by-value argument in message expression is undefined.}}
[aArray addObject:aString]; // expected-warning {{Argument in message expression is an uninitialized value}}
}

Просмотреть файл

@ -30,7 +30,7 @@ extern NSString * const NSUndoManagerCheckpointNotification;
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is a garbage value}}
id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}}
NSLog(@"%@", someUnintializedPointer);
[pool drain];
return 0;

Просмотреть файл

@ -15,7 +15,7 @@ int f1_a(struct FPRec* foo) {
int f1_b() {
int x;
return bar(x)+1; // expected-warning{{Pass-by-value argument in function call is undefined.}}
return bar(x)+1; // expected-warning{{Function call argument is an uninitialized value}}
}
int f2() {