From 818b433a943653b329df56bdaa1b18385603d2bd Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 9 Sep 2010 22:51:55 +0000 Subject: [PATCH] Clean up obtuse wording of checker diagnostic of using an uninitialized value in a function call. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: “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 --- lib/Checker/CallAndMessageChecker.cpp | 12 ++++++------ test/Analysis/misc-ps-region-store.m | 4 ++-- test/Analysis/misc-ps.m | 4 ++-- test/Analysis/null-deref-ps.c | 2 +- test/Analysis/uninit-msg-expr.m | 4 ++-- test/Analysis/uninit-ps-rdar6145427.m | 2 +- test/Analysis/uninit-vals-ps.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/Checker/CallAndMessageChecker.cpp b/lib/Checker/CallAndMessageChecker.cpp index 3c9ddce9f6..0d397a2942 100644 --- a/lib/Checker/CallAndMessageChecker.cpp +++ b/lib/Checker/CallAndMessageChecker.cpp @@ -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; } diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m index 27aaff09e2..720342a229 100644 --- a/test/Analysis/misc-ps-region-store.m +++ b/test/Analysis/misc-ps-region-store.m @@ -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); diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m index 206eb51371..1d6e6f6153 100644 --- a/test/Analysis/misc-ps.m +++ b/test/Analysis/misc-ps.m @@ -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}} } //===----------------------------------------------------------------------===// diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c index d4d18b4ff3..58f5d30c09 100644 --- a/test/Analysis/null-deref-ps.c +++ b/test/Analysis/null-deref-ps.c @@ -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}} } diff --git a/test/Analysis/uninit-msg-expr.m b/test/Analysis/uninit-msg-expr.m index 4061150ec5..a8e2f1b655 100644 --- a/test/Analysis/uninit-msg-expr.m +++ b/test/Analysis/uninit-msg-expr.m @@ -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}} } diff --git a/test/Analysis/uninit-ps-rdar6145427.m b/test/Analysis/uninit-ps-rdar6145427.m index 1409dbd1df..ccaf2e8105 100644 --- a/test/Analysis/uninit-ps-rdar6145427.m +++ b/test/Analysis/uninit-ps-rdar6145427.m @@ -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; diff --git a/test/Analysis/uninit-vals-ps.c b/test/Analysis/uninit-vals-ps.c index 4abd413ae5..9e53fbc348 100644 --- a/test/Analysis/uninit-vals-ps.c +++ b/test/Analysis/uninit-vals-ps.c @@ -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() {