]> granicus.if.org Git - clang/commitdiff
Prep for new warning.
authorMike Stump <mrs@apple.com>
Wed, 22 Jul 2009 00:43:08 +0000 (00:43 +0000)
committerMike Stump <mrs@apple.com>
Wed, 22 Jul 2009 00:43:08 +0000 (00:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76709 91177308-0d34-0410-b5e6-96231b3b80d8

54 files changed:
test/Parser/CompoundStmtScope.c
test/Parser/MicrosoftExtensions.c
test/Parser/argument_redef.c
test/Parser/bad-control.c
test/Parser/declarators.c
test/Parser/implicit-casts.c
test/Parser/objc-messaging-neg-1.m
test/Parser/recovery.c
test/Parser/statements.c
test/Rewriter/id-test-3.m
test/Rewriter/method-encoding-1.m
test/Rewriter/rewrite-foreach-4.m
test/Rewriter/rewrite-foreach-5.m
test/Sema/arg-scope-c99.c
test/Sema/arg-scope.c
test/Sema/array-constraint.c
test/Sema/array-init.c
test/Sema/attr-weak.c
test/Sema/block-misc.c
test/Sema/builtin-prefetch.c
test/Sema/builtins.c
test/Sema/c89.c
test/Sema/darwin-align-cast.c
test/Sema/decl-type-merging.c
test/Sema/heinous-extensions-on.c
test/Sema/implicit-int.c
test/Sema/redefinition.c
test/Sema/type-spec-struct-union.c
test/Sema/va_arg_x86_64.c
test/SemaCXX/abstract.cpp
test/SemaCXX/warn-for-var-in-else.cpp
test/SemaObjC/access-property-getter.m
test/SemaObjC/category-method-lookup-2.m
test/SemaObjC/compatible-protocol-qualified-types.m
test/SemaObjC/comptypes-a.m
test/SemaObjC/interface-scope-2.m
test/SemaObjC/method-arg-decay.m
test/SemaObjC/method-conflict.m
test/SemaObjC/method-encoding-2.m
test/SemaObjC/method-lookup-2.m
test/SemaObjC/method-lookup.m
test/SemaObjC/method-typecheck-1.m
test/SemaObjC/no-warn-unimpl-method.m
test/SemaObjC/property-11.m
test/SemaObjC/property-9-impl-method.m
test/SemaObjC/property-method-lookup-impl.m
test/SemaObjC/protocol-implementation-inherited.m
test/SemaObjC/protocol-lookup.m
test/SemaObjC/super-cat-prot.m
test/SemaObjC/super.m
test/SemaObjC/synchronized.m
test/SemaObjC/weak-attr-ivar.m
test/SemaObjCXX/protocol-lookup.mm
test/SemaTemplate/ext-vector-type.cpp

index 6a404aa3a2c6844fcb015976c65df0bb410e31c0..90e3d24a32f5c938b915fbb51d7ff1e20a8fc0c1 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc -fsyntax-only -verify %s
 
-int foo() {
+void foo() {
   {
     typedef float X;
   }
index 6f5622e93932027fa9448eb73466bd205a95efdd..d794fcfe8b42e0cfd922ec91dcda7493c07eabc8 100644 (file)
@@ -11,7 +11,7 @@ void * __ptr64 PtrToPtr64(const void *p)
 {
     return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
 }
-__forceinline InterlockedBitTestAndSet (long *Base, long Bit)  // expected-warning {{type specifier missing, defaults to 'int'}}
+void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
 {
     __asm {
            mov eax, Bit
index 1a43178a40cd16f81348d43d4b80aa9cf83d997c..fd22c465e5c6ad5db0b11574ac2daa7a3b275e95 100644 (file)
@@ -1,6 +1,6 @@
 /* RUN: clang-cc -fsyntax-only -verify %s
 */
 
-int foo(int A) { /* expected-note {{previous definition is here}} */
+void foo(int A) { /* expected-note {{previous definition is here}} */
   int A; /* expected-error {{redefinition of 'A'}} */
 }
index 6e59667c354968a1ace8873ca6c921601a725562..0bdd179af215ceca883dcc111aa5f09141ed76a7 100644 (file)
@@ -1,9 +1,9 @@
 /* RUN: clang-cc -fsyntax-only -verify %s
 */
-int foo() { 
+void foo() { 
   break; /* expected-error {{'break' statement not in loop or switch statement}} */
 }
 
-int foo2() { 
+void foo2() { 
   continue; /* expected-error {{'continue' statement not in loop statement}} */
 }
index 26e8027d10782fb4f1c28c86e13007c88679d141..da8327a1e834f104940032ab7d940e31f69d72c1 100644 (file)
@@ -18,7 +18,7 @@ int *A;
 
 struct str;
 
-int test2(int *P, int A) {
+void test2(int *P, int A) {
   struct str;
 
   // Hard case for array decl, not Array[*].
@@ -26,11 +26,11 @@ int test2(int *P, int A) {
 }
 
 typedef int atype;
-int test3(x, 
-          atype         /* expected-error {{unexpected type name 'atype': expected identifier}} */
-         ) int x, atype; {}
+void test3(x, 
+           atype         /* expected-error {{unexpected type name 'atype': expected identifier}} */
+          ) int x, atype; {}
 
-int test4(x, x) int x; {} /* expected-error {{redefinition of parameter 'x'}} */
+void test4(x, x) int x; {} /* expected-error {{redefinition of parameter 'x'}} */
 
 
 // PR3031
index e7d20980da47594479b91e607c88d86c7f5228ec..3e8f599047c451d898658aae6129c3daaf18735c 100644 (file)
@@ -15,6 +15,7 @@ void test2() {
 int test3() {
   int a[2];
   a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning 'int ()', expected 'int'}}
+  return 0;
 }
 short x; void test4(char c) { x += c; }
 int y; void test5(char c) { y += c; }
index a1ec116fb7b42581c3c08243d5652e444e5286df..0344566aa87a855bdae787f6e6d4313932cb97c8 100644 (file)
@@ -1,7 +1,6 @@
 // RUN: clang-cc -fsyntax-only -verify %s
 
-int main()
-   {
-     id a;
-     [a bla:0 6:7]; // expected-error {{expected ']'}}
-   }
+int main() {
+  id a;
+  [a bla:0 6:7]; // expected-error {{expected ']'}}
+}
index 89eac564a329a614f5b58f5cc3abcf5ff7563e2d..43d3e2d8a69da4fb48f7ad9b82529822e300823f 100644 (file)
@@ -8,10 +8,10 @@ float test2241[2] = {
 
 
 // Testcase derived from PR2692
-static char *f (char * (*g) (char **, int), char **p, ...) {
-    char *s;
-    va_list v;                              // expected-error {{identifier}}
-    s = g (p, __builtin_va_arg(v, int));    // expected-error {{identifier}}
+static void f (char * (*g) (char **, int), char **p, ...) {
+  char *s;
+  va_list v;                              // expected-error {{identifier}}
+  s = g (p, __builtin_va_arg(v, int));    // expected-error {{identifier}}
 }
 
 
@@ -20,7 +20,7 @@ static char *f (char * (*g) (char **, int), char **p, ...) {
 
 
 // rdar://6094870
-int test(int a) {
+void test(int a) {
   struct { int i; } x;
   
   if (x.hello)   // expected-error {{no member named 'hello'}}
@@ -61,7 +61,7 @@ struct S A = {
 };
 
 // rdar://6248081
-int test6248081() { 
+void test6248081() { 
   [10]  // expected-error {{expected expression}}
 }
 
index b95c23fb28b0ff9db3fc09a30defb22e89ab2fda..a55b2c23f6c9f372c1d8b022f12e79d7e85f7868 100644 (file)
@@ -1,10 +1,10 @@
 // RUN: clang-cc -fsyntax-only -verify %s
 
-int test1() {
+void test1() {
   { ; {  ;;}} ;;
 }
 
-int test2() {
+void test2() {
   if (0) { if (1) {} } else { }
 
   do { } while (0); 
@@ -18,7 +18,7 @@ int test2() {
   for (int X = 0; 0; 0);
 }
 
-int test3() {
+void test3() {
     switch (0) {
     
     case 4:
@@ -30,7 +30,7 @@ int test3() {
   }
 }
 
-int test4() {
+void test4() {
   if (0);  // expected-warning {{if statement has empty body}}
   
   int X;  // declaration in a block.
index ad1e76decf80784fd2fff993561e7bb7ced1abd5..7e4cc51d735713756d19aa562b2856b100a5dfb4 100644 (file)
@@ -10,5 +10,5 @@
 
 @implementation INTF
 - (id<P>)IMeth { return [(id<P>)self Meth: (id<P>)0]; }
-- (id<P>) Meth : (id<P>) Arg {}
+- (id<P>) Meth : (id<P>) Arg { return 0; }
 @end
index 25dccbf7508403d9c8bf3866456fe786eeb34ea5..05df60291e02d7e0c22d3ab237e6dbd68796f8e4 100644 (file)
@@ -11,8 +11,8 @@
 @end
 
 @implementation Intf
-- (char *) MyMeth : (double) arg1 : (char *[12]) arg2{}
+- (char *) MyMeth : (double) arg1 : (char *[12]) arg2{ return 0; }
 - (void) MyProtoMeth : (int **) arg1 : (void*) arg2 {}
 + (void) MyProtoMeth : (int **) arg1 : (void*) arg2 {}
-- (id) address:(void *)location with:(unsigned **)arg2{}
+- (id) address:(void *)location with:(unsigned **)arg2{ return 0; }
 @end
index 774f9a0b75c891a5fa8b4464f6cf57f1067662d3..5c831ea18b205ea6c4d7a03c37072376ae4b535f 100644 (file)
@@ -9,7 +9,7 @@
 {
         return 0;
 }
-- (id) allKeys {}
+- (id) allKeys { return 0; }
 @end
 
 @interface MyList (BasicTest)
index d0d12444a3e799a6ec94733efeabcb0b349154cf..d03f6ce84df6d249c9713e8c0b39d3cbf9ba8b71 100644 (file)
@@ -9,7 +9,7 @@
 {
         return 0;
 }
-- (id) allKeys {}
+- (id) allKeys { return 0; }
 @end
 
 @interface MyList (BasicTest)
index b5b1c8a812c1e1bd56c3a9f3dd4e417ca96abce3..1d81410b8d01666c05b0822f619361be90c608a4 100644 (file)
@@ -1,2 +1,2 @@
 // RUN: clang-cc -fsyntax-only -std=c99 -verify %s
-int bb(int sz, int ar[sz][sz]) { }
+void bb(int sz, int ar[sz][sz]) { }
index c1cc7e112f882ec3b2e52c169e1b3dd6a181464b..d5e59603cfbf7115392c3f79815b62cb76ad09f0 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: clang-cc -fsyntax-only -verify %s
-int aa(int b, int x[sizeof b]) {}
+void aa(int b, int x[sizeof b]) {}
 
 void foo(int i, int A[i]) {}
 
index 5a09e20ecbff0ef463d3fe3cd61fea36d455f42e..6407b5daf56a3bf2a60d9d56471156b4a389bff1 100644 (file)
@@ -45,7 +45,7 @@ typedef int TA[I]; // expected-error {{variable length array declaration not all
 
 void strFunc(char *);
 const char staticAry[] = "test";
-int checkStaticAry() { 
+void checkStaticAry() { 
   strFunc(staticAry); // expected-warning{{passing 'char const [5]' discards qualifiers, expected 'char *'}}
 }
 
index 50148a83ae13c7e529f5046ae064ed8e123112de..b7542b301bda5bbf8559200b68dbd818dbee8ce1 100644 (file)
@@ -219,10 +219,10 @@ void varArray() {
 }
 
 // PR2151
-int emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct extension}} expected-error{{initializer for aggregate with no elements}}
+void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct extension}} expected-error{{initializer for aggregate with no elements}}
 
-int noNamedInit() {
-struct {int:5;} x[] = {6}; //expected-error{{initializer for aggregate with no elements}}
+void noNamedInit() {
+  struct {int:5;} x[] = {6}; //expected-error{{initializer for aggregate with no elements}}
 }
 struct {int a; int:5;} noNamedImplicit[] = {1,2,3};
 int noNamedImplicitCheck[sizeof(noNamedImplicit) == 3 * sizeof(*noNamedImplicit) ? 1 : -1];
index 4e288673feb6cf59b9cb2acf98ad6417c4eb434f..4532cccf98d9023a453dfdaca12b72991ee6e274 100644 (file)
@@ -5,7 +5,7 @@ extern int g1 __attribute__((weak_import));
 int g2 __attribute__((weak));
 int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
 int __attribute__((weak_import)) g4(void);
-int __attribute__((weak_import)) g5(void) { 
+void __attribute__((weak_import)) g5(void) { 
 }
 
 struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variable and function types}}
index 1f1cad44a94d9023f76337aa1f04db2e22191bc0..a9a7df61fec1328c2f39e893c449cb25d682a922 100644 (file)
@@ -44,7 +44,7 @@ int test2(double (^S)()) {
 int^ x; // expected-error {{block pointer to non-function type is invalid}}
 int^^ x1; // expected-error {{block pointer to non-function type is invalid}} expected-error {{block pointer to non-function type is invalid}}
 
-int test3() {
+void test3() {
   char *^ y; // expected-error {{block pointer to non-function type is invalid}}
 }
 
index 6b39e75d525771d20dfae3c30433addaaf2938d3..bf28277acb81c32c4f72f7c1b3ffb438c1fc9702 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc -fsyntax-only -verify %s
 
-int foo() {
+void foo() {
   int a;
   __builtin_prefetch(&a);
   __builtin_prefetch(&a, 1);
index 78b75624ea24167eb102c9da83bebdcfd11a6b24..068f3006f4a65e3efae4563f892bd19126deb87a 100644 (file)
@@ -34,7 +34,7 @@ void test7() {
 
 // atomics.
 
-unsigned char test9(short v) {
+void test9(short v) {
   unsigned i, old;
   
   old = __sync_fetch_and_add();  // expected-error {{too few arguments to function call}}
index e7585c31926c3f42ede604c8d67a3ab93e7a2d25..9bf720b6a399eed9b5a5df676b262b02975fd6b9 100644 (file)
@@ -36,7 +36,7 @@ int *__restrict;  /* expected-error {{expected identifier}} */
 
 
 /* Implicit int, always ok */
-test6() {}
+test6() { return 0; }
 
 /* PR2012 */
 test7;  /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
index 09808b5af2e83d22935abac598d2c0095ac00564..313a9e341092b23b19052ba42a21770d016b64f5 100644 (file)
@@ -19,5 +19,6 @@ ssize_t sendFileDescriptor(int fd, void *data, size_t nbytes, int sendfd) {
   union {
     char control[(((__darwin_size_t)((char *)(sizeof(struct cmsghdr)) + (sizeof(__darwin_size_t) - 1)) &~ (sizeof(__darwin_size_t) - 1)) + ((__darwin_size_t)((char *)(sizeof(int)) + (sizeof(__darwin_size_t) - 1)) &~ (sizeof(__darwin_size_t) - 1)))];
   } control_un;
+  return 0;
 }
 
index 1b789a142ade0dc175abefbe5b191ed42973f49b..1a8601298e9ab12a8f4bf85b31a7348cb0c463e5 100644 (file)
@@ -6,11 +6,11 @@ int testx[(sizeof(x) == sizeof(int) * 10) ? 1 : -1];
 
 int (*a)(int (*x)[10], int (*y)[]);
 int (*a)(int (*x)[], int (*y)[5]);
-int b() {
-int x[10], y[5];
-a(&x, &y);
-a(&y, &y); // expected-warning {{incompatible pointer}}
-a(&x, &x); // expected-warning {{incompatible pointer}}
+void b() {
+  int x[10], y[5];
+  a(&x, &y);
+  a(&y, &y); // expected-warning {{incompatible pointer}}
+  a(&x, &x); // expected-warning {{incompatible pointer}}
 }
 
 
index 480b1b41e906743896fa66b2abb5f996c19d2899..a56f1f6f625cf195aa2f8226a3fe005251f96719 100644 (file)
@@ -1,10 +1,9 @@
 // RUN: clang-cc %s -verify -fheinous-gnu-extensions
 
-int foo() {
-        int a;
-        // PR3788
-        asm("nop" : : "m"((int)(a))); // expected-warning {{cast in a inline asm context requiring an l-value}}
-        // PR3794
-        asm("nop" : "=r"((unsigned)a)); // expected-warning {{cast in a inline asm context requiring an l-value}}
+void foo() {
+  int a;
+  // PR3788
+  asm("nop" : : "m"((int)(a))); // expected-warning {{cast in a inline asm context requiring an l-value}}
+  // PR3794
+  asm("nop" : "=r"((unsigned)a)); // expected-warning {{cast in a inline asm context requiring an l-value}}
 }
-
index 04b27a8f0ea9d32a6fd9322cc479edddbfbce778..9eab953b3fc55d69b8ec3cc51c519276abb76011 100644 (file)
@@ -1,6 +1,7 @@
 // RUN: clang-cc -fsyntax-only %s -verify -pedantic
 
 foo() { // expected-warning {{type specifier missing, defaults to 'int'}}
+  return 0;
 }
 
 y;  // expected-warning {{type specifier missing, defaults to 'int'}}
index 26c90c8e6d4f4bead02281414305843a88962ae1..9339bb935f6c6237de84312ca51e92b8c919bfef 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: clang-cc %s -fsyntax-only -verify
-int f(int a) { } // expected-note {{previous definition is here}}
+int f(int a) { return 0; } // expected-note {{previous definition is here}}
 int f(int);
-int f(int a) { } // expected-error {{redefinition of 'f'}}
+int f(int a) { return 0; } // expected-error {{redefinition of 'f'}}
 
 // <rdar://problem/6097326>
 int foo(x) {
index 2b68b7877318e072d7a33d779a4f06d7b12e47aa..003efb14620bb04a47a440dfa74a52c5f02193ef 100644 (file)
@@ -57,7 +57,7 @@ struct bar_baz {
   } mode;
   int             nowrap;
 };
-int 
+void
 wizbiz_quxPoof(z)
   z_foop       z;
 {
index 680abb714b91c5e60162b9cebb5d8085d9cfea41..61ac97b7d45183ad4644351974abb3770648753c 100644 (file)
@@ -8,9 +8,8 @@ char* foo(char *fmt, __builtin_va_list ap)
 
 // PR2692
 typedef __builtin_va_list va_list;
-static char *f (char * (*g) (char **, int), char **p, ...) {
-    char *s;
-    va_list v;
-    s = g (p, __builtin_va_arg(v, int));
+static void f (char * (*g) (char **, int), char **p, ...) {
+  char *s;
+  va_list v;
+  s = g (p, __builtin_va_arg(v, int));
 }
-
index dc764da5322b57da7f4bd1b91a4b647034a98a64..2d466c203d0fee3dcb8a98e804c64a8d0d4e3a0b 100644 (file)
@@ -54,7 +54,7 @@ typedef void (*Func)(C); // expected-error {{parameter type 'C' is an abstract c
 void t6(Func);
 
 class F {
-    F a() { } // expected-error {{return type 'F' is an abstract class}}
+    F a() { while (1) {} } // expected-error {{return type 'F' is an abstract class}}
     
     class D {
         void f(F c); // expected-error {{parameter type 'F' is an abstract class}}
index 3368da223a48ee7d0e9f12cb9f50c234ecca367f..f73c60689446c62f971b38836d4845542be7590a 100644 (file)
@@ -8,6 +8,7 @@ int foo() {
     return X;
   } else {
     do_something(X); // expected-warning{{'X' is always zero in this context}}
+    return 0;
   }
 }
 
index 50a301688905ba489954c1e128d9a0633a0b1399..225d63b0173c7fb9c75a669e091a9bb96d78312c 100644 (file)
@@ -31,5 +31,6 @@
 - (id)harvestPredictivelyProcessedOutputFiles
 {
      _outputStream.release;
+     return 0;
 }
 @end
index 76048cc2f74cfb693fdc56bc104dcd34bc1a4250..15da63783fee60062237ee03ec74cecbf137af5a 100644 (file)
@@ -17,6 +17,7 @@ typedef struct objc_class *Class;
 
 - instanceMethod {
   [[self class] classMethod];
+  return 0;
 }
 
 @end
index 3c27b5f0d3cd6dde0f79e80e9db6f9dc1dbd5cfd..71f00542b1c63773e2c95062c57b0e7fd90231e4 100644 (file)
@@ -70,6 +70,7 @@ extern NSString * const XCActiveSelectionLevel;
 
 - (NSTextStorage *)contents {
  [_contents setDelegate:self]; // expected-warning {{incompatible type sending 'SKTText *', expected 'id<NSTextStorageDelegate>'}}
+ return 0;
 }
 
 @end
index 936c6dfc5de90e0346a5e818cf1dc44fefac11f8..5570d56b0b83bcc3f81d1eebc655754c2f23e6f4 100644 (file)
@@ -13,6 +13,7 @@ extern NSInteger codeAssistantCaseCompareItems(id a, id b, void *context);
 
 NSInteger codeAssistantCaseCompareItems(id<PBXCompletionItem> a, id<PBXCompletionItem> b, void *context)
 {
+  return 0;
 }
 
 @interface TedWantsToVerifyObjCDoesTheRightThing
index d054e714f3b2ed46726d458cd3436bbd41be61ed..c9025903940c9009668ced8d05617d7a95accd0a 100644 (file)
@@ -83,6 +83,7 @@ typedef struct __LoreStuffNode {} LoreStuffNode;
 - init {
   LoreStuffNode *node;
   node = &(_historyStuff[1]);
+  return 0;
 }
 @end
 
@@ -108,6 +109,7 @@ _nfttFlags;
   if (self != ((void *)0)) {
     (void)memset(&_nfttFlags, 0, sizeof(struct _OingoBoingoContraptionPeonFlags));
   }
+  return 0;
 }
 @end
 
index 4b045914c0958a475fc60a374d281a054a499c1b..7fd07d2ede3369046cb10d6e5a01e3f2762f48b7 100644 (file)
@@ -87,6 +87,7 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos
       PBXModule *obj = [XCFindPossibleKeyModules(pModule, (BOOL)0) objectOfType:type     matchingFunction:comparator usingData:data];
     }
   }
+  return 0;
 }
 - (BOOL)buffer:(char *)buf containsAnyPrompts:(char *[])prompts
 {
index 7a9b9f0beee84f221d8b0fe906e9f11363b1160f..a4213f6c63c9e676da428402344d82a5643fca7a 100644 (file)
@@ -47,7 +47,9 @@ typedef NSUInteger XDSourceLanguage;
 
 + appendVisibility: (id <XDUMLNamedElement>) element withSpecification: (XDSCDisplaySpecification *) displaySpec to: (NSMutableAttributedString *) attributedString
 {
+  return 0;
 }
-+ (NSUInteger) compartmentsForClassifier: (id <XDSCClassifier>) classifier withSpecification: (XDSCDisplaySpecification *) displaySpec { 
++ (NSUInteger) compartmentsForClassifier: (id <XDSCClassifier>) classifier withSpecification: (XDSCDisplaySpecification *) displaySpec {
+  return 0;
 }
 @end 
index 64a0bc4c323d07e289cb2bd1cb0b0c37fecb808f..b3ffdcd0585c218c216780838c52396eb830c22e 100644 (file)
@@ -7,6 +7,6 @@
 @end
 
 @implementation Intf
-- (in out bycopy id) address:(byref inout void *)location with:(out oneway unsigned **)arg2{}
-- (id) another:(void *)location with:(unsigned **)arg2 {}
+- (in out bycopy id) address:(byref inout void *)location with:(out oneway unsigned **)arg2{ return 0; }
+- (id) another:(void *)location with:(unsigned **)arg2 { return 0; }
 @end
index dd0bca93644eac7ce1e5bc292e24b7a529d4de99..cca757509ad196a879b52d81b8c45ba302b36151 100644 (file)
@@ -35,8 +35,8 @@ extern NSString *const NSWillBecomeMultiThreadedNotification;
 
 @implementation SenTestTool
 + (void) initialize {}
-+(SenTestTool *) sharedInstance {}
--(int) run {}
++(SenTestTool *) sharedInstance { return 0; }
+-(int) run { return 0; }
 +(int) run {
   return[[self sharedInstance] run];
 }
@@ -57,6 +57,7 @@ extern NSString *const NSWillBecomeMultiThreadedNotification;
 - whatever {
   id obj = [[XX alloc] init];
   [[obj class] classMethod];
+  return 0;
 }
 
 @end
index 917ad6b3ee92cda86f69f1ed5596de15385fb515..49dc789af7832a29ad62903ed0c9850b6598c128 100644 (file)
@@ -29,6 +29,7 @@ static NSMutableArray * recentCompletions = ((void *)0);
             [(id)item setPriority:[item priority] / [PBXCodeAssistant factorForRecentCompletion:[item name]]];
         }
     }
+    return 0;
 }
 @end
 
index d110c858a41aedb62ce808e11542088267f23e58..a53c4d9f416a8798c144190f826ccd9c9b5fedae 100644 (file)
@@ -8,8 +8,8 @@
 
 @implementation A 
 -(void) setMoo: (float) x {}   //  expected-warning {{conflicting parameter types in implementation of 'setMoo:': 'int' vs 'float'}}
-- (char) setMoo1: (int) x {}   //  expected-warning {{conflicting return type in implementation of 'setMoo1:': 'int' vs 'char'}}
-- (int) setOk : (int) x : (double) d {}
+- (char) setMoo1: (int) x { return 0; }        //  expected-warning {{conflicting return type in implementation of 'setMoo1:': 'int' vs 'char'}}
+- (int) setOk : (int) x : (double) d { return 0; }
 @end
 
 
@@ -20,7 +20,7 @@
 
 @implementation C 
 +(float) cMoo:   // expected-warning {{conflicting return type in implementation of 'cMoo:': 'void' vs 'float'}}
-   (float) x {}        //  expected-warning {{conflicting parameter types in implementation of 'cMoo:': 'int' vs 'float'}}
+   (float) x { return 0; }     //  expected-warning {{conflicting parameter types in implementation of 'cMoo:': 'int' vs 'float'}}
 @end
 
 
@@ -31,7 +31,6 @@
 
 @implementation A(CAT) 
 -(float) setCat:  // expected-warning {{conflicting return type in implementation of 'setCat:': 'void' vs 'float'}}
-(float) x {}   //  expected-warning {{conflicting parameter types in implementation of 'setCat:': 'int' vs 'float'}}
-+ (int) cCat: (int) x {}       //  expected-warning {{conflicting return type in implementation of 'cCat:': 'void' vs 'int'}}
+(float) x { return 0; }        //  expected-warning {{conflicting parameter types in implementation of 'setCat:': 'int' vs 'float'}}
++ (int) cCat: (int) x { return 0; }    //  expected-warning {{conflicting return type in implementation of 'cCat:': 'void' vs 'int'}}
 @end
-
index 756c47b2fe80d60161ba127408eed8bcde6c039f..2fcb06ff5e92d77a2ba6fb9a4ead1cb28ea7cdd6 100644 (file)
@@ -38,5 +38,5 @@
         - (void)forwardInvocation:(NSInvocation *)anInvocation
         {
         }
-       - (id) init {}        
+       - (id) init { return 0; }
 @end
index e8e60914716d53fa9738cb42879415e3dadbd32a..bb36c2766e75a78b3dcff4aaaa07043b00db6996 100644 (file)
@@ -29,6 +29,7 @@
   o = x.foo;
   [x setFoo:o];
   x.foo = o;
+  return 0;
 }
 
 @end
index c97f388911908907457d3e481a24bdf7d9e8e07c..06cb30482c826ce8083f316bbd3bca2c7f6dd1f3 100644 (file)
@@ -55,10 +55,11 @@ NSSize minimumSize;
 
 @implementation OrganizerTabView
 @dynamic tabHeaderView, headerRect, minimumSize;
--(CGFloat) tabAreaThickness {}
+-(CGFloat) tabAreaThickness { return 0; }
 -(NSRectEdge) rectEdgeForTabs { 
   NSRect dummy, result = {};
   NSDivideRect(self.bounds, &result, &dummy, self.tabAreaThickness, self.rectEdgeForTabs);
+  return 0;
 }
 @end
 
index ed7e9bcd4315546d60ed3c72fedd5d007c76d8f2..295bba524009c0d3e866667504fcc24b28208b23 100644 (file)
@@ -8,9 +8,7 @@
 
 @implementation SSyncCEList
 
-- (id) list
-{
-}
+- (id) list { return 0; }
 @end
 
 @interface SSyncConflictList : SSyncCEList
index 1aace211c844cef82ce9ae314cb236dd4dab53c2..55b92ae6684afda9616fe1fd8562714492ac40a8 100644 (file)
@@ -26,7 +26,7 @@
 @end
 
 @implementation B1
--foo {};
+-foo { return 0; };
 @end
 
 // Interface conforms to a protocol whose methods are provided by an
index 0f1860d2c88edf0e4bfd99bf4ab7637ed28bbae9..87655bd9e7a01e18a16cff5d573f9f2054bb63c6 100644 (file)
@@ -44,6 +44,7 @@
        [_foo release];
        [_bar release];
        [super dealloc];
+       return 0;
 }
 
 @end
index 1ab0752faa38d66487885d1f4e409d5cafa94a92..6ddc31fbb9e6600104a9953cce7eac8436188004 100644 (file)
@@ -35,14 +35,16 @@ typedef struct _IBInset {} IBInset;
 @interface NSView (NSView_IBViewProtocol) <IBViewProtocol>  - (NSRect)layoutRect; @end
 typedef enum { NSProTextFieldSquareBezel = 0, NSProTextFieldRoundedBezel = 1, NSProTextFieldDisplayBezel = 2 } MKModuleReusePolicy;
 @implementation NSProBox(IBAdditions)
--(NSString *)inspectorClassName {}
+-(NSString *)inspectorClassName { return 0; }
 -(IBInset)ibShadowInset {
   if ([self boxType] == NSBoxSeparator) {
     return [super ibShadowInset];
   }
+  while (1) {}
 }
 -(NSSize)minimumFrameSizeFromKnobPosition:(IBKnobPosition)knobPosition {
   if ([self boxType] != NSBoxSeparator)
     return [super minimumFrameSizeFromKnobPosition:knobPosition];
+  while (1) {}
 }
 @end
index 9afd4eb983c57f4275d60bd6bf63921edfa96650..83842afb9c3f272f17366c444104fcd7ed78f3d6 100644 (file)
@@ -21,6 +21,7 @@
 
 + classMethod {
   [super cMethod]; // expected-warning{{method '+cMethod' not found (return type defaults to 'id')}}
+  return 0;
 }
 @end
 
index 7131265b5bb7bbf35de68e81888c36cf638e0477..01f82c1686221d848e1c7fe7c8d88c63f9139ce0 100644 (file)
@@ -3,7 +3,7 @@
 @interface PBXTrackableTaskManager @end
 
 @implementation PBXTrackableTaskManager
-- (id) init {}
+- (id) init { return 0; }
 - (void) unregisterTask:(id) task {
   @synchronized (self) {
   id taskID = [task taskIdentifier];  // expected-warning {{method '-taskIdentifier' not found (return type defaults to 'id')}}
index 9e0e8cb4b3af376d03497f91c8751715034cedd2..6af96ddb3c8b25c52a4b36eb4bf5a46761f133a1 100644 (file)
@@ -45,8 +45,7 @@ typedef enum { Foo_HUH_NONE } FooHUHCode;
 }
 @property(copy) NSString *author;
 - (BOOL) isInteresting;
-@end  NSString *FooHUHCodeToString(FooHUHCode HUH) {
-}
+@end  NSString *FooHUHCodeToString(FooHUHCode HUH) { return 0; }
 @interface FooHUHCodeToStringTransformer: NSValueTransformer {
 }
 @end  @implementation FooPlaypenEntry  @synthesize author = _author;
@@ -62,12 +61,14 @@ typedef enum { Foo_HUH_NONE } FooHUHCode;
       }
     }
   }
+  return 0;
 }
 - (FooHUHCode) HUH {
   if (_HUH == Foo_HUH_NONE) {
     if (_mostInterestingChild)
       return [_mostInterestingChild HUH];
   }
+  return 0;
 }
 @end
 
index 0f1860d2c88edf0e4bfd99bf4ab7637ed28bbae9..87655bd9e7a01e18a16cff5d573f9f2054bb63c6 100644 (file)
@@ -44,6 +44,7 @@
        [_foo release];
        [_bar release];
        [super dealloc];
+       return 0;
 }
 
 @end
index d6c02bb629ff10189dc50db39de06b348ee2b2cc..b6aebc102fb464e41a13dc8694c7f00c005abbc2 100644 (file)
@@ -4,7 +4,7 @@ struct make1 {
   typedef T __attribute__((ext_vector_type(Length))) type; 
 };
 
-int test_make1() {
+void test_make1() {
   make1<int, 5>::type x;
   x.x = 4;
 }