c return warning cleanups

Richard Henderson rth@redhat.com
Thu Feb 7 03:01:00 GMT 2002


	* gcc.dg/debug/dwarf2-1.c: Update for return warnings.
	* gcc.dg/noncompile/920507-1.c, gcc.dg/noncompile/920721-2.c,
	gcc.dg/noncompile/label-lineno-1.c, objc.dg/const-str-1.m,
	objc.dg/const-str-2.m, objc.dg/method-1.m: Likewise.

Index: gcc.dg/debug/dwarf2-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/debug/dwarf2-1.c,v
retrieving revision 1.1
diff -c -p -d -u -r1.1 dwarf2-1.c
--- dwarf2-1.c	2002/01/26 02:38:57	1.1
+++ dwarf2-1.c	2002/02/07 08:40:16
@@ -5,7 +5,7 @@
 
 static int foo () {}
 
-int bar () {
+void bar () {
   int foo ();
   int foo ();
 }
Index: gcc.dg/noncompile/920507-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/noncompile/920507-1.c,v
retrieving revision 1.1
diff -c -p -d -u -r1.1 920507-1.c
--- 920507-1.c	2000/06/29 19:55:26	1.1
+++ 920507-1.c	2002/02/07 08:40:16
@@ -1,4 +1,4 @@
-int
+void
 x(void)
 {
  register int *a asm("unknown_register");  /* { dg-error "invalid register" } */
Index: gcc.dg/noncompile/920721-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/noncompile/920721-2.c,v
retrieving revision 1.1
diff -c -p -d -u -r1.1 920721-2.c
--- 920721-2.c	2000/06/29 19:55:26	1.1
+++ 920721-2.c	2002/02/07 08:40:16
@@ -1,4 +1,4 @@
-int f(int n)
+void f(int n)
 {
 int s;
 for(s=0;s<n;s++)
Index: gcc.dg/noncompile/label-lineno-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c,v
retrieving revision 1.1
diff -c -p -d -u -r1.1 label-lineno-1.c
--- label-lineno-1.c	2000/08/23 21:12:15	1.1
+++ label-lineno-1.c	2002/02/07 08:40:16
@@ -1,7 +1,7 @@
 /* Ensure that diagnostics for labels appear on the correct lineno.
    by Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/23/2000.  */
 
-int
+void
 foo(int i)
 {
  my_label:
Index: objc.dg/const-str-1.m
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/objc.dg/const-str-1.m,v
retrieving revision 1.2
diff -c -p -d -u -r1.2 const-str-1.m
--- const-str-1.m	2001/12/02 00:04:36	1.2
+++ const-str-1.m	2002/02/07 08:40:16
@@ -2,7 +2,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fgnu-runtime" } */
 
-int foo()
+void foo()
 {
   baz(@"hiya");  /* { dg-error "annot find interface declaration" } */
 }
@@ -10,7 +10,7 @@ int foo()
 @interface NXConstantString
 @end
 
-int bar()
+void bar()
 {
   baz(@"howdah");
 }
Index: objc.dg/const-str-2.m
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/objc.dg/const-str-2.m,v
retrieving revision 1.1
diff -c -p -d -u -r1.1 const-str-2.m
--- const-str-2.m	2001/06/18 16:48:37	1.1
+++ const-str-2.m	2002/02/07 08:40:16
@@ -4,7 +4,7 @@
 
 { dg-error "no class name specified as argument to -fconstant-string-class" "" { target *-*-* } 0 }
 
-int foo () {}
+void foo () {}
 
 /* Seem bogus, should investigate some day.  */
 /* { dg-error "parse error" "" { target *-*-* } 5 } */
Index: objc.dg/method-1.m
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/objc.dg/method-1.m,v
retrieving revision 1.1
diff -c -p -d -u -r1.1 method-1.m
--- method-1.m	2001/06/18 16:48:37	1.1
+++ method-1.m	2002/02/07 08:40:16
@@ -16,8 +16,8 @@
 @end
 
 @implementation class3
-- (int) meth1 {}
-- (int) meth1 {}  /* { dg-error "duplicate definition of instance method" } */
+- (int) meth1 { return 0; }
+- (int) meth1 { return 0; }  /* { dg-error "duplicate definition of instance method" } */
 /* { dg-error "redefinition of" "" { target *-*-* } 20 } */
 /* { dg-error "previously defined here" "" { target *-*-* } 19 } */
 @end



More information about the Gcc-patches mailing list