Jan Kratochvil 2116e53
http://sourceware.org/ml/gdb-patches/2016-01/msg00137.html
Jan Kratochvil 2116e53
Subject: [testsuite patch] Fix gdb.multi/base.exp testsuite regression  [Re: [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/]
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
--fdj2RfSjLxBAspz7
Jan Kratochvil 2116e53
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil 2116e53
Content-Disposition: inline
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
On Thu, 10 Dec 2015 17:31:11 +0100, Pedro Alves wrote:
Jan Kratochvil 2116e53
> Several of the gdb.multi tests use the "nowarnings" option to suppress
Jan Kratochvil 2116e53
> warnings.
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
commit 762f774785f4ef878ac4c831e1f4733dc957234d
Jan Kratochvil 2116e53
Author: Pedro Alves <palves@redhat.com>
Jan Kratochvil 2116e53
Date:   Thu Dec 10 16:21:06 2015 +0000
Jan Kratochvil 2116e53
    Stop using nowarnings in gdb/testsuite/gdb.multi/
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
+gdb compile failed, gdb/testsuite/gdb.multi/hello.c: In function 'commonfun':
Jan Kratochvil 2116e53
+gdb/testsuite/gdb.multi/hello.c:24:19: warning: implicit declaration of function 'bar' [-Wimplicit-function-declaration]
Jan Kratochvil 2116e53
+ int commonfun() { bar(); } /* from hello */
Jan Kratochvil 2116e53
+                   ^
Jan Kratochvil 2116e53
+gdb/testsuite/gdb.multi/hello.c: At top level:
Jan Kratochvil 2116e53
+gdb/testsuite/gdb.multi/hello.c:26:1: warning: return type defaults to 'int' [-Wimplicit-int]
Jan Kratochvil 2116e53
+ bar()
Jan Kratochvil 2116e53
+ ^
Jan Kratochvil 2116e53
+gdb/testsuite/gdb.multi/hello.c:32:1: warning: return type defaults to 'int' [-Wimplicit-int]
Jan Kratochvil 2116e53
+ hello(int x)
Jan Kratochvil 2116e53
+ ^
Jan Kratochvil 2116e53
+gdb/testsuite/gdb.multi/hello.c:38:1: warning: return type defaults to 'int' [-Wimplicit-int]
Jan Kratochvil 2116e53
+ main()
Jan Kratochvil 2116e53
+ ^
Jan Kratochvil 2116e53
+UNTESTED: gdb.multi/base.exp: base.exp
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
OK for check-in?
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
Jan
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
--fdj2RfSjLxBAspz7
Jan Kratochvil 2116e53
Content-Type: text/plain; charset=us-ascii
Jan Kratochvil 2116e53
Content-Disposition: inline; filename=1
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
gdb/testsuite/ChangeLog
Jan Kratochvil 2116e53
2016-01-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
	* gdb.multi/goodbye.c: Fix compilation warnings by adding return types
Jan Kratochvil 2116e53
	and reordering the functions.
Jan Kratochvil 2116e53
	* gdb.multi/hangout.c: Likewise.
Jan Kratochvil 2116e53
	* gdb.multi/hello.c: Likewise.
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
diff --git a/gdb/testsuite/gdb.multi/goodbye.c b/gdb/testsuite/gdb.multi/goodbye.c
Jan Kratochvil 2116e53
index 701e504..bf7759a 100644
Jan Kratochvil 2116e53
--- a/gdb/testsuite/gdb.multi/goodbye.c
Jan Kratochvil 2116e53
+++ b/gdb/testsuite/gdb.multi/goodbye.c
Jan Kratochvil 2116e53
@@ -39,24 +39,28 @@ int verylongfun()
Jan Kratochvil 2116e53
   glob *= 9;
Jan Kratochvil 2116e53
 }
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
-main() {
Jan Kratochvil 2116e53
-  mailand();
Jan Kratochvil 2116e53
-  foo(glob);
Jan Kratochvil 2116e53
-  verylongfun();
Jan Kratochvil 2116e53
-  goodbye();
Jan Kratochvil 2116e53
-}
Jan Kratochvil 2116e53
-
Jan Kratochvil 2116e53
-foo(int x) {
Jan Kratochvil 2116e53
-  return x + 92;
Jan Kratochvil 2116e53
-}
Jan Kratochvil 2116e53
-
Jan Kratochvil 2116e53
+void
Jan Kratochvil 2116e53
 mailand()
Jan Kratochvil 2116e53
 {
Jan Kratochvil 2116e53
   glob = 46;
Jan Kratochvil 2116e53
 }
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
-void commonfun() { mailand(); } /* from goodbye */
Jan Kratochvil 2116e53
+int
Jan Kratochvil 2116e53
+foo(int x) {
Jan Kratochvil 2116e53
+  return x + 92;
Jan Kratochvil 2116e53
+}
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
+void
Jan Kratochvil 2116e53
 goodbye() {
Jan Kratochvil 2116e53
   ++glob;
Jan Kratochvil 2116e53
 }
Jan Kratochvil 2116e53
+
Jan Kratochvil 2116e53
+int
Jan Kratochvil 2116e53
+main() {
Jan Kratochvil 2116e53
+  mailand();
Jan Kratochvil 2116e53
+  foo(glob);
Jan Kratochvil 2116e53
+  verylongfun();
Jan Kratochvil 2116e53
+  goodbye();
Jan Kratochvil 2116e53
+}
Jan Kratochvil 2116e53
+
Jan Kratochvil 2116e53
+void commonfun() { mailand(); } /* from goodbye */
Jan Kratochvil 2116e53
diff --git a/gdb/testsuite/gdb.multi/hangout.c b/gdb/testsuite/gdb.multi/hangout.c
Jan Kratochvil 2116e53
index e2c41b8..3701512 100644
Jan Kratochvil 2116e53
--- a/gdb/testsuite/gdb.multi/hangout.c
Jan Kratochvil 2116e53
+++ b/gdb/testsuite/gdb.multi/hangout.c
Jan Kratochvil 2116e53
@@ -17,6 +17,7 @@
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
 #include <stdio.h>
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
+int
Jan Kratochvil 2116e53
 main(int argc, char *argv[])
Jan Kratochvil 2116e53
 {
Jan Kratochvil 2116e53
   int i;
Jan Kratochvil 2116e53
diff --git a/gdb/testsuite/gdb.multi/hello.c b/gdb/testsuite/gdb.multi/hello.c
Jan Kratochvil 2116e53
index efff59d..93d921f 100644
Jan Kratochvil 2116e53
--- a/gdb/testsuite/gdb.multi/hello.c
Jan Kratochvil 2116e53
+++ b/gdb/testsuite/gdb.multi/hello.c
Jan Kratochvil 2116e53
@@ -21,20 +21,23 @@ short hglob = 1;
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
 short glob = 92;
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
-int commonfun() { bar(); } /* from hello */
Jan Kratochvil 2116e53
-
Jan Kratochvil 2116e53
+void
Jan Kratochvil 2116e53
 bar()
Jan Kratochvil 2116e53
 {
Jan Kratochvil 2116e53
   if (glob == 0)
Jan Kratochvil 2116e53
     exit(1);
Jan Kratochvil 2116e53
 }
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
+int commonfun() { bar(); } /* from hello */
Jan Kratochvil 2116e53
+
Jan Kratochvil 2116e53
+int
Jan Kratochvil 2116e53
 hello(int x)
Jan Kratochvil 2116e53
 {
Jan Kratochvil 2116e53
   x *= 2;
Jan Kratochvil 2116e53
   return x + 45;
Jan Kratochvil 2116e53
 }
Jan Kratochvil 2116e53
 
Jan Kratochvil 2116e53
+int
Jan Kratochvil 2116e53
 main()
Jan Kratochvil 2116e53
 {
Jan Kratochvil 2116e53
   int tmpx;
Jan Kratochvil 2116e53
Jan Kratochvil 2116e53
--fdj2RfSjLxBAspz7--
Jan Kratochvil 2116e53