diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/CFNumber.c | 6 | ||||
-rw-r--r-- | test/Analysis/CheckNSError.m | 4 | ||||
-rw-r--r-- | test/Analysis/array-struct.c | 2 | ||||
-rw-r--r-- | test/Analysis/keychainAPI.m | 6 | ||||
-rw-r--r-- | test/Analysis/malloc-annotations.c | 4 | ||||
-rw-r--r-- | test/Analysis/malloc.c | 6 | ||||
-rw-r--r-- | test/Analysis/misc-ps-region-store.m | 2 | ||||
-rw-r--r-- | test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m | 4 | ||||
-rw-r--r-- | test/Analysis/ptr-arith.c | 6 | ||||
-rw-r--r-- | test/Analysis/security-syntax-checks.m | 8 | ||||
-rw-r--r-- | test/Analysis/sizeofpointer.c | 2 | ||||
-rw-r--r-- | test/Analysis/stream.c | 16 | ||||
-rw-r--r-- | test/Analysis/variadic-method-types.m | 2 |
13 files changed, 34 insertions, 34 deletions
diff --git a/test/Analysis/CFNumber.c b/test/Analysis/CFNumber.c index fbbe4d15f4..537e497851 100644 --- a/test/Analysis/CFNumber.c +++ b/test/Analysis/CFNumber.c @@ -17,11 +17,11 @@ typedef const struct __CFNumber * CFNumberRef; extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); CFNumberRef f1(unsigned char x) { - return CFNumberCreate(0, kCFNumberSInt16Type, &x); // expected-warning{{An 8 bit integer is used to initialize a CFNumber object that represents a 16 bit integer. 8 bits of the CFNumber value will be garbage.}} + return CFNumberCreate(0, kCFNumberSInt16Type, &x); // expected-warning{{An 8 bit integer is used to initialize a CFNumber object that represents a 16 bit integer. 8 bits of the CFNumber value will be garbage}} } __attribute__((cf_returns_retained)) CFNumberRef f2(unsigned short x) { - return CFNumberCreate(0, kCFNumberSInt8Type, &x); // expected-warning{{A 16 bit integer is used to initialize a CFNumber object that represents an 8 bit integer. 8 bits of the input integer will be lost.}} + return CFNumberCreate(0, kCFNumberSInt8Type, &x); // expected-warning{{A 16 bit integer is used to initialize a CFNumber object that represents an 8 bit integer. 8 bits of the input integer will be lost}} } // test that the attribute overrides the naming convention. @@ -30,5 +30,5 @@ __attribute__((cf_returns_not_retained)) CFNumberRef CreateNum(unsigned char x) } CFNumberRef f3(unsigned i) { - return CFNumberCreate(0, kCFNumberLongType, &i); // expected-warning{{A 32 bit integer is used to initialize a CFNumber object that represents a 64 bit integer.}} + return CFNumberCreate(0, kCFNumberLongType, &i); // expected-warning{{A 32 bit integer is used to initialize a CFNumber object that represents a 64 bit integer}} } diff --git a/test/Analysis/CheckNSError.m b/test/Analysis/CheckNSError.m index d35b686ef1..cdec1d50f2 100644 --- a/test/Analysis/CheckNSError.m +++ b/test/Analysis/CheckNSError.m @@ -23,7 +23,7 @@ extern NSString * const NSXMLParserErrorDomain ; @implementation A - (void)myMethodWhichMayFail:(NSError **)error { // expected-warning {{Method accepting NSError** should have a non-void return value to indicate whether or not an error occurred}} - *error = [NSError errorWithDomain:@"domain" code:1 userInfo:0]; // expected-warning {{Potential null dereference.}} + *error = [NSError errorWithDomain:@"domain" code:1 userInfo:0]; // expected-warning {{Potential null dereference}} } - (BOOL)myMethodWhichMayFail2:(NSError **)error { // no-warning @@ -36,7 +36,7 @@ struct __CFError {}; typedef struct __CFError* CFErrorRef; void foo(CFErrorRef* error) { // expected-warning {{Function accepting CFErrorRef* should have a non-void return value to indicate whether or not an error occurred}} - *error = 0; // expected-warning {{Potential null dereference.}} + *error = 0; // expected-warning {{Potential null dereference}} } int f1(CFErrorRef* error) { diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c index c5bdb86a14..1b36190729 100644 --- a/test/Analysis/array-struct.c +++ b/test/Analysis/array-struct.c @@ -151,7 +151,7 @@ struct s3 p[1]; // an ElementRegion of type 'char'. Then load a nonloc::SymbolVal from it and // assigns to 'a'. void f16(struct s3 *p) { - struct s3 a = *((struct s3*) ((char*) &p[0])); // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.}} + struct s3 a = *((struct s3*) ((char*) &p[0])); // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption}} } void inv(struct s1 *); diff --git a/test/Analysis/keychainAPI.m b/test/Analysis/keychainAPI.m index cb4f72c9c4..585a32ddc3 100644 --- a/test/Analysis/keychainAPI.m +++ b/test/Analysis/keychainAPI.m @@ -76,7 +76,7 @@ void errRetVal() { UInt32 length; void *outData; st = SecKeychainItemCopyContent(2, ptr, ptr, &length, &outData); - if (st == GenericError) // expected-warning{{Allocated data is not released: missing a call to 'SecKeychainItemFreeContent'.}} + if (st == GenericError) // expected-warning{{Allocated data is not released: missing a call to 'SecKeychainItemFreeContent'}} SecKeychainItemFreeContent(ptr, outData); // expected-warning{{Only call free if a valid (non-NULL) buffer was returned}} } @@ -220,7 +220,7 @@ int foo(CFTypeRef keychainOrArray, SecProtocolType protocol, if (st == noErr) SecKeychainItemFreeContent(ptr, outData[3]); } - if (length) { // expected-warning{{Allocated data is not released: missing a call to 'SecKeychainItemFreeContent'.}} + if (length) { // expected-warning{{Allocated data is not released: missing a call to 'SecKeychainItemFreeContent'}} length++; } return 0; @@ -318,7 +318,7 @@ void radar10508828_2() { UInt32 pwdLen = 0; void* pwdBytes = 0; OSStatus rc = SecKeychainFindGenericPassword(0, 3, "foo", 3, "bar", &pwdLen, &pwdBytes, 0); - SecKeychainItemFreeContent(0, pwdBytes); // expected-warning {{Only call free if a valid (non-NULL) buffer was returned.}} + SecKeychainItemFreeContent(0, pwdBytes); // expected-warning {{Only call free if a valid (non-NULL) buffer was returned}} } //Example from bug 10797. diff --git a/test/Analysis/malloc-annotations.c b/test/Analysis/malloc-annotations.c index 1dc0f7837b..9c040b688d 100644 --- a/test/Analysis/malloc-annotations.c +++ b/test/Analysis/malloc-annotations.c @@ -208,11 +208,11 @@ void f7_realloc() { } void PR6123() { - int *x = malloc(11); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}} + int *x = malloc(11); // expected-warning{{Cast a region whose size is not a multiple of the destination type size}} } void PR7217() { - int *buf = malloc(2); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}} + int *buf = malloc(2); // expected-warning{{Cast a region whose size is not a multiple of the destination type size}} buf[1] = 'c'; // not crash } diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c index f60271f39f..e3d92d9ad6 100644 --- a/test/Analysis/malloc.c +++ b/test/Analysis/malloc.c @@ -260,11 +260,11 @@ void f7_realloc() { } void PR6123() { - int *x = malloc(11); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}} + int *x = malloc(11); // expected-warning{{Cast a region whose size is not a multiple of the destination type size}} } void PR7217() { - int *buf = malloc(2); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}} + int *buf = malloc(2); // expected-warning{{Cast a region whose size is not a multiple of the destination type size}} buf[1] = 'c'; // not crash } @@ -389,7 +389,7 @@ void mallocEscapeMalloc() { void mallocMalloc() { int *p = malloc(12); - p = malloc(12); // expected-warning 2 {{Memory is never released; potential leak}} + p = malloc(12); // expected-warning {{Memory is never released; potential leak}} } void mallocFreeMalloc() { diff --git a/test/Analysis/misc-ps-region-store.m b/test/Analysis/misc-ps-region-store.m index 88860bbe10..2b481c4a55 100644 --- a/test/Analysis/misc-ps-region-store.m +++ b/test/Analysis/misc-ps-region-store.m @@ -299,7 +299,7 @@ void test_handle_array_wrapper_helper(); int test_handle_array_wrapper() { struct ArrayWrapper x; test_handle_array_wrapper_helper(&x); - struct WrappedStruct *p = (struct WrappedStruct*) x.y; // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.}} + struct WrappedStruct *p = (struct WrappedStruct*) x.y; // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption}} return p->z; // no-warning } diff --git a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m index e4d5aaf82b..7cf2aee35f 100644 --- a/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m +++ b/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m @@ -80,11 +80,11 @@ int handleVoidInComma() { int marker(void) { // control reaches end of non-void function } +// CHECK-darwin8: warning: The receiver of message 'longDoubleM' is nil and returns a value of type 'long double' that will be garbage // CHECK-darwin8: warning: The receiver of message 'longlongM' is nil and returns a value of type 'long long' that will be garbage -// CHECK-darwin8: warning: The receiver of message 'unsignedLongLongM' is nil and returns a value of type 'unsigned long long' that will be garbage // CHECK-darwin8: warning: The receiver of message 'doubleM' is nil and returns a value of type 'double' that will be garbage +// CHECK-darwin8: warning: The receiver of message 'unsignedLongLongM' is nil and returns a value of type 'unsigned long long' that will be garbage // CHECK-darwin8: warning: The receiver of message 'longlongM' is nil and returns a value of type 'long long' that will be garbage -// CHECK-darwin8: warning: The receiver of message 'longDoubleM' is nil and returns a value of type 'long double' that will be garbage // CHECK-darwin9-NOT: warning: The receiver of message 'longlongM' is nil and returns a value of type 'long long' that will be garbage // CHECK-darwin9-NOT: warning: The receiver of message 'unsignedLongLongM' is nil and returns a value of type 'unsigned long long' that will be garbage diff --git a/test/Analysis/ptr-arith.c b/test/Analysis/ptr-arith.c index 6567000c73..884ae5b9bb 100644 --- a/test/Analysis/ptr-arith.c +++ b/test/Analysis/ptr-arith.c @@ -36,7 +36,7 @@ domain_port (const char *domain_b, const char *domain_e, void f3() { int x, y; - int d = &y - &x; // expected-warning{{Subtraction of two pointers that do not point to the same memory chunk may cause incorrect result.}} + int d = &y - &x; // expected-warning{{Subtraction of two pointers that do not point to the same memory chunk may cause incorrect result}} int a[10]; int *p = &a[2]; @@ -46,13 +46,13 @@ void f3() { void f4() { int *p; - p = (int*) 0x10000; // expected-warning{{Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.}} + p = (int*) 0x10000; // expected-warning{{Using a fixed address is not portable because that address will probably not be valid in all environments or platforms}} } void f5() { int x, y; int *p; - p = &x + 1; // expected-warning{{Pointer arithmetic done on non-array variables means reliance on memory layout, which is dangerous.}} + p = &x + 1; // expected-warning{{Pointer arithmetic done on non-array variables means reliance on memory layout, which is dangerous}} int a[10]; p = a + 1; // no-warning diff --git a/test/Analysis/security-syntax-checks.m b/test/Analysis/security-syntax-checks.m index f4ccefe58c..1df8a408a6 100644 --- a/test/Analysis/security-syntax-checks.m +++ b/test/Analysis/security-syntax-checks.m @@ -46,7 +46,7 @@ int getpw(unsigned int uid, char *buf); void test_getpw() { char buff[1024]; - getpw(2, buff); // expected-warning{{The getpw() function is dangerous as it may overflow the provided buffer. It is obsoleted by getpwuid().}} + getpw(2, buff); // expected-warning{{The getpw() function is dangerous as it may overflow the provided buffer. It is obsoleted by getpwuid()}} } // <rdar://problem/6337132> CWE-273: Failure to Check Whether Privileges Were @@ -138,7 +138,7 @@ void test_strcpy() { char x[4]; char *y; - strcpy(x, y); //expected-warning{{Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119.}} + strcpy(x, y); //expected-warning{{Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119}} } //===----------------------------------------------------------------------=== @@ -162,7 +162,7 @@ void test_strcat() { char x[4]; char *y; - strcat(x, y); //expected-warning{{Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119.}} + strcat(x, y); //expected-warning{{Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119}} } //===----------------------------------------------------------------------=== @@ -173,7 +173,7 @@ typedef __int32_t pid_t; pid_t vfork(void); void test_vfork() { - vfork(); //expected-warning{{Call to function 'vfork' is insecure as it can lead to denial of service situations in the parent process.}} + vfork(); //expected-warning{{Call to function 'vfork' is insecure as it can lead to denial of service situations in the parent process}} } //===----------------------------------------------------------------------=== diff --git a/test/Analysis/sizeofpointer.c b/test/Analysis/sizeofpointer.c index 0c86de88ae..aa85fc002a 100644 --- a/test/Analysis/sizeofpointer.c +++ b/test/Analysis/sizeofpointer.c @@ -4,5 +4,5 @@ struct s { }; int f(struct s *p) { - return sizeof(p); // expected-warning{{The code calls sizeof() on a pointer type. This can produce an unexpected result.}} + return sizeof(p); // expected-warning{{The code calls sizeof() on a pointer type. This can produce an unexpected result}} } diff --git a/test/Analysis/stream.c b/test/Analysis/stream.c index e68835e5cf..4a095cffd0 100644 --- a/test/Analysis/stream.c +++ b/test/Analysis/stream.c @@ -16,25 +16,25 @@ extern void rewind (FILE *__stream); void f1(void) { FILE *p = fopen("foo", "r"); char buf[1024]; - fread(buf, 1, 1, p); // expected-warning {{Stream pointer might be NULL.}} + fread(buf, 1, 1, p); // expected-warning {{Stream pointer might be NULL}} fclose(p); } void f2(void) { FILE *p = fopen("foo", "r"); - fseek(p, 1, SEEK_SET); // expected-warning {{Stream pointer might be NULL.}} + fseek(p, 1, SEEK_SET); // expected-warning {{Stream pointer might be NULL}} fclose(p); } void f3(void) { FILE *p = fopen("foo", "r"); - ftell(p); // expected-warning {{Stream pointer might be NULL.}} + ftell(p); // expected-warning {{Stream pointer might be NULL}} fclose(p); } void f4(void) { FILE *p = fopen("foo", "r"); - rewind(p); // expected-warning {{Stream pointer might be NULL.}} + rewind(p); // expected-warning {{Stream pointer might be NULL}} fclose(p); } @@ -43,26 +43,26 @@ void f5(void) { if (!p) return; fseek(p, 1, SEEK_SET); // no-warning - fseek(p, 1, 3); // expected-warning {{The whence argument to fseek() should be SEEK_SET, SEEK_END, or SEEK_CUR.}} + fseek(p, 1, 3); // expected-warning {{The whence argument to fseek() should be SEEK_SET, SEEK_END, or SEEK_CUR}} fclose(p); } void f6(void) { FILE *p = fopen("foo", "r"); fclose(p); - fclose(p); // expected-warning {{Try to close a file Descriptor already closed. Cause undefined behaviour.}} + fclose(p); // expected-warning {{Try to close a file Descriptor already closed. Cause undefined behaviour}} } void f7(void) { FILE *p = tmpfile(); - ftell(p); // expected-warning {{Stream pointer might be NULL.}} + ftell(p); // expected-warning {{Stream pointer might be NULL}} fclose(p); } void f8(int c) { FILE *p = fopen("foo.c", "r"); if(c) - return; // expected-warning {{Opened File never closed. Potential Resource leak.}} + return; // expected-warning {{Opened File never closed. Potential Resource leak}} fclose(p); } diff --git a/test/Analysis/variadic-method-types.m b/test/Analysis/variadic-method-types.m index 4d0f6bc3f7..9f90e5ff34 100644 --- a/test/Analysis/variadic-method-types.m +++ b/test/Analysis/variadic-method-types.m @@ -74,7 +74,7 @@ void f(id a, id<P> b, C* c, C<P> *d, FooType fooType, BarType barType) { [NSArray arrayWithObjects:@"Hello", a, b, c, d, nil]; [NSArray arrayWithObjects:@"Foo", ^{}, nil]; - [NSArray arrayWithObjects:@"Foo", "Bar", "Baz", nil]; // expected-warning 2 {{Argument to 'NSArray' method 'arrayWithObjects:' should be an Objective-C pointer type, not 'char *'}} + [NSArray arrayWithObjects:@"Foo", "Bar", "Baz", nil]; // expected-warning {{Argument to 'NSArray' method 'arrayWithObjects:' should be an Objective-C pointer type, not 'char *'}} [NSDictionary dictionaryWithObjectsAndKeys:@"Foo", "Bar", nil]; // expected-warning {{Argument to 'NSDictionary' method 'dictionaryWithObjectsAndKeys:' should be an Objective-C pointer type, not 'char *'}} [NSSet setWithObjects:@"Foo", "Bar", nil]; // expected-warning {{Argument to 'NSSet' method 'setWithObjects:' should be an Objective-C pointer type, not 'char *'}} [NSOrderedSet orderedSetWithObjects:@"Foo", "Bar", nil]; // expected-warning {{Argument to 'NSOrderedSet' method 'orderedSetWithObjects:' should be an Objective-C pointer type, not 'char *'}} |