From 6cfc1fcb515d1ecd8445905b4749b81b3ca69552 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 8 Jan 2016 20:07:02 +0100 Subject: [PATCH] Fix gdb.multi/base.exp testsuite regression Regressed by: commit 762f774785f4ef878ac4c831e1f4733dc957234d Author: Pedro Alves Date: Thu Dec 10 16:21:06 2015 +0000 Stop using nowarnings in gdb/testsuite/gdb.multi/ +gdb compile failed, gdb/testsuite/gdb.multi/hello.c: In function 'commonfun': +gdb/testsuite/gdb.multi/hello.c:24:19: warning: implicit declaration of function 'bar' [-Wimplicit-function-declaration] + int commonfun() { bar(); } /* from hello */ + ^ +gdb/testsuite/gdb.multi/hello.c: At top level: +gdb/testsuite/gdb.multi/hello.c:26:1: warning: return type defaults to 'int' [-Wimplicit-int] + bar() + ^ +gdb/testsuite/gdb.multi/hello.c:32:1: warning: return type defaults to 'int' [-Wimplicit-int] + hello(int x) + ^ +gdb/testsuite/gdb.multi/hello.c:38:1: warning: return type defaults to 'int' [-Wimplicit-int] + main() + ^ +UNTESTED: gdb.multi/base.exp: base.exp gdb/testsuite/ChangeLog 2016-01-08 Jan Kratochvil * gdb.multi/goodbye.c: Fix compilation warnings by adding return types and reordering the functions. * gdb.multi/hangout.c: Likewise. * gdb.multi/hello.c: Likewise. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.multi/goodbye.c | 28 ++++++++++++++++------------ gdb/testsuite/gdb.multi/hangout.c | 1 + gdb/testsuite/gdb.multi/hello.c | 7 +++++-- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6fd6e4f8063..ac726851ace 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2016-01-08 Jan Kratochvil + + * gdb.multi/goodbye.c: Fix compilation warnings by adding return types + and reordering the functions. + * gdb.multi/hangout.c: Likewise. + * gdb.multi/hello.c: Likewise. + 2016-01-08 Simon Marchi * gdb.perf/lib/perftest/perftest.py: Change relative imports to diff --git a/gdb/testsuite/gdb.multi/goodbye.c b/gdb/testsuite/gdb.multi/goodbye.c index 701e504a3b7..bf7759a794c 100644 --- a/gdb/testsuite/gdb.multi/goodbye.c +++ b/gdb/testsuite/gdb.multi/goodbye.c @@ -39,24 +39,28 @@ int verylongfun() glob *= 9; } -main() { - mailand(); - foo(glob); - verylongfun(); - goodbye(); -} - -foo(int x) { - return x + 92; -} - +void mailand() { glob = 46; } -void commonfun() { mailand(); } /* from goodbye */ +int +foo(int x) { + return x + 92; +} +void goodbye() { ++glob; } + +int +main() { + mailand(); + foo(glob); + verylongfun(); + goodbye(); +} + +void commonfun() { mailand(); } /* from goodbye */ diff --git a/gdb/testsuite/gdb.multi/hangout.c b/gdb/testsuite/gdb.multi/hangout.c index e2c41b8c949..37015128739 100644 --- a/gdb/testsuite/gdb.multi/hangout.c +++ b/gdb/testsuite/gdb.multi/hangout.c @@ -17,6 +17,7 @@ #include +int main(int argc, char *argv[]) { int i; diff --git a/gdb/testsuite/gdb.multi/hello.c b/gdb/testsuite/gdb.multi/hello.c index efff59d0fa4..93d921f68a1 100644 --- a/gdb/testsuite/gdb.multi/hello.c +++ b/gdb/testsuite/gdb.multi/hello.c @@ -21,20 +21,23 @@ short hglob = 1; short glob = 92; -int commonfun() { bar(); } /* from hello */ - +void bar() { if (glob == 0) exit(1); } +int commonfun() { bar(); } /* from hello */ + +int hello(int x) { x *= 2; return x + 45; } +int main() { int tmpx; -- 2.30.2