From a59add0c2ed21c03efc8b39e333564d7713a7ccc Mon Sep 17 00:00:00 2001 From: Andreas Arnez Date: Tue, 28 Oct 2014 12:39:22 +0000 Subject: [PATCH] GDB testsuite: Fix warnings with -std=gnu11 Since upstream GCC has changed the default C language dialect to 'gnu11', it yields multiple warnings in the GDB testsuite for missing function return types and implicit function declarations. This patch attempts to fix these. gdb/testsuite/ChangeLog: * gdb.ada/cond_lang/foo.c (callme): Add return type. * gdb.base/call-sc.c (zed): Likewise. * gdb.base/checkpoint.c (main): Likewise. * gdb.base/dump.c (main): Likewise. * gdb.base/gcore.c (main): Likewise. * gdb.base/huge.c (main): Likewise. * gdb.base/multi-forks.c (main): Likewise. * gdb.base/pr10179-a.c (main): Likewise. * gdb.base/savedregs.c (main): Likewise. * gdb.base/sigaltstack.c (main): Likewise. * gdb.base/siginfo.c (main): Likewise. * gdb.base/structs.c (zed): Likewise. * gdb.mi/mi-stack.c (callee3, callee2, callee1, main): Likewise. * gdb.mi/mi-syn-frame.c (main): Likewise. * gdb.mi/until.c (foo, main): Likewise. * gdb.base/global-var-nested-by-dso.c (b_main, c_main): Declare. * gdb.base/solib-weak.c (foo): Declare. * gdb.base/attach-twice.c: Include stdio.h. * gdb.base/weaklib1.c: Likewise. * gdb.base/weaklib2.c: Likewise. * gdb.base/catch-signal-fork.c: Include stdio.h and sys/wait.h. * gdb.mi/mi-condbreak-call-thr-state-mt.c: Include stdio.h and unistd.h. * gdb.base/attach-pie-misread.c: Include stdlib.h. * gdb.mi/mi-exit-code.c: Likewise. * gdb.base/break-interp-lib.c: Include string.h. * gdb.base/coremaker.c: Likewise. * gdb.base/testenv.c: Likewise. * gdb.python/py-finish-breakpoint.c: Likewise. * gdb.base/inferior-died.c: Include sys/wait.h. * gdb.base/fileio.c: Include time.h. * gdb.base/async-shell.c: Include unistd.h. * gdb.base/dprintf-non-stop.c: Likewise. * gdb.base/info-os.c: Likewise. * gdb.mi/mi-console.c: Likewise. * gdb.mi/watch-nonstop.c: Likewise. * gdb.python/py-events.c: Likewise. * gdb.base/async.c (baz): Move up before its invocation. * gdb.base/code_elim2.c (my_global_func): Likewise. * gdb.base/skip-solib-lib.c (multiply): Likewise. * gdb.base/advance.c (func2): Likewise. --- gdb/testsuite/ChangeLog | 44 +++++++++++++++++++ gdb/testsuite/gdb.ada/cond_lang/foo.c | 2 +- gdb/testsuite/gdb.base/advance.c | 10 ++--- gdb/testsuite/gdb.base/async-shell.c | 2 + gdb/testsuite/gdb.base/async.c | 13 +++--- gdb/testsuite/gdb.base/attach-pie-misread.c | 1 + gdb/testsuite/gdb.base/attach-twice.c | 1 + gdb/testsuite/gdb.base/break-interp-lib.c | 1 + gdb/testsuite/gdb.base/call-sc.c | 2 +- gdb/testsuite/gdb.base/catch-signal-fork.c | 2 + gdb/testsuite/gdb.base/checkpoint.c | 7 +-- gdb/testsuite/gdb.base/code_elim2.c | 12 ++--- gdb/testsuite/gdb.base/coremaker.c | 1 + gdb/testsuite/gdb.base/dprintf-non-stop.c | 2 + gdb/testsuite/gdb.base/dump.c | 2 + gdb/testsuite/gdb.base/fileio.c | 1 + gdb/testsuite/gdb.base/gcore.c | 1 + .../gdb.base/global-var-nested-by-dso.c | 3 ++ gdb/testsuite/gdb.base/huge.c | 1 + gdb/testsuite/gdb.base/inferior-died.c | 1 + gdb/testsuite/gdb.base/info-os.c | 1 + gdb/testsuite/gdb.base/multi-forks.c | 3 +- gdb/testsuite/gdb.base/pr10179-a.c | 1 + gdb/testsuite/gdb.base/savedregs.c | 2 + gdb/testsuite/gdb.base/sigaltstack.c | 2 + gdb/testsuite/gdb.base/siginfo.c | 1 + gdb/testsuite/gdb.base/skip-solib-lib.c | 8 ++-- gdb/testsuite/gdb.base/solib-weak.c | 2 + gdb/testsuite/gdb.base/structs.c | 1 + gdb/testsuite/gdb.base/testenv.c | 1 + gdb/testsuite/gdb.base/weaklib1.c | 2 + gdb/testsuite/gdb.base/weaklib2.c | 2 + .../gdb.mi/mi-condbreak-call-thr-state-mt.c | 2 + gdb/testsuite/gdb.mi/mi-console.c | 2 + gdb/testsuite/gdb.mi/mi-exit-code.c | 2 + gdb/testsuite/gdb.mi/mi-stack.c | 9 ++-- gdb/testsuite/gdb.mi/mi-syn-frame.c | 2 + gdb/testsuite/gdb.mi/until.c | 2 + gdb/testsuite/gdb.mi/watch-nonstop.c | 2 + gdb/testsuite/gdb.python/py-events.c | 2 + .../gdb.python/py-finish-breakpoint.c | 1 + 41 files changed, 127 insertions(+), 32 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a3ee4933867..405548e3944 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,47 @@ +2014-11-13 Andreas Arnez + + * gdb.ada/cond_lang/foo.c (callme): Add return type. + * gdb.base/call-sc.c (zed): Likewise. + * gdb.base/checkpoint.c (main): Likewise. + * gdb.base/dump.c (main): Likewise. + * gdb.base/gcore.c (main): Likewise. + * gdb.base/huge.c (main): Likewise. + * gdb.base/multi-forks.c (main): Likewise. + * gdb.base/pr10179-a.c (main): Likewise. + * gdb.base/savedregs.c (main): Likewise. + * gdb.base/sigaltstack.c (main): Likewise. + * gdb.base/siginfo.c (main): Likewise. + * gdb.base/structs.c (zed): Likewise. + * gdb.mi/mi-stack.c (callee3, callee2, callee1, main): Likewise. + * gdb.mi/mi-syn-frame.c (main): Likewise. + * gdb.mi/until.c (foo, main): Likewise. + * gdb.base/global-var-nested-by-dso.c (b_main, c_main): Declare. + * gdb.base/solib-weak.c (foo): Declare. + * gdb.base/attach-twice.c: Include stdio.h. + * gdb.base/weaklib1.c: Likewise. + * gdb.base/weaklib2.c: Likewise. + * gdb.base/catch-signal-fork.c: Include stdio.h and sys/wait.h. + * gdb.mi/mi-condbreak-call-thr-state-mt.c: Include stdio.h and + unistd.h. + * gdb.base/attach-pie-misread.c: Include stdlib.h. + * gdb.mi/mi-exit-code.c: Likewise. + * gdb.base/break-interp-lib.c: Include string.h. + * gdb.base/coremaker.c: Likewise. + * gdb.base/testenv.c: Likewise. + * gdb.python/py-finish-breakpoint.c: Likewise. + * gdb.base/inferior-died.c: Include sys/wait.h. + * gdb.base/fileio.c: Include time.h. + * gdb.base/async-shell.c: Include unistd.h. + * gdb.base/dprintf-non-stop.c: Likewise. + * gdb.base/info-os.c: Likewise. + * gdb.mi/mi-console.c: Likewise. + * gdb.mi/watch-nonstop.c: Likewise. + * gdb.python/py-events.c: Likewise. + * gdb.base/async.c (baz): Move up before its invocation. + * gdb.base/code_elim2.c (my_global_func): Likewise. + * gdb.base/skip-solib-lib.c (multiply): Likewise. + * gdb.base/advance.c (func2): Likewise. + 2014-11-13 Andreas Arnez * gdb.base/annota1.c: Remove #ifdef PROTOTYPES, keep prototyped diff --git a/gdb/testsuite/gdb.ada/cond_lang/foo.c b/gdb/testsuite/gdb.ada/cond_lang/foo.c index 3861da77ab6..d701f62c320 100644 --- a/gdb/testsuite/gdb.ada/cond_lang/foo.c +++ b/gdb/testsuite/gdb.ada/cond_lang/foo.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -extern callme (void); +extern void callme (void); void c_function (void) diff --git a/gdb/testsuite/gdb.base/advance.c b/gdb/testsuite/gdb.base/advance.c index 8066deec421..ab86b0e5696 100644 --- a/gdb/testsuite/gdb.base/advance.c +++ b/gdb/testsuite/gdb.base/advance.c @@ -13,15 +13,15 @@ int bar (int y) return z; } -void func() +int func2 () { - x = x + 5; - func2 (); + x = 6; } -int func2 () +void func() { - x = 6; + x = x + 5; + func2 (); } int func3 () diff --git a/gdb/testsuite/gdb.base/async-shell.c b/gdb/testsuite/gdb.base/async-shell.c index 3629d770fec..1b63be12e7d 100644 --- a/gdb/testsuite/gdb.base/async-shell.c +++ b/gdb/testsuite/gdb.base/async-shell.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + int main (void) { diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c index 32779d97b93..9148b1913d3 100644 --- a/gdb/testsuite/gdb.base/async.c +++ b/gdb/testsuite/gdb.base/async.c @@ -12,6 +12,12 @@ foo (void) return x + y; } +int +baz (void) +{ + return 5; +} + int main (void) { @@ -25,10 +31,3 @@ main (void) y = baz (); return 0; /* until here */ } - - -int -baz (void) -{ - return 5; -} diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.c b/gdb/testsuite/gdb.base/attach-pie-misread.c index 7de2ad380ea..08789d0011c 100644 --- a/gdb/testsuite/gdb.base/attach-pie-misread.c +++ b/gdb/testsuite/gdb.base/attach-pie-misread.c @@ -16,6 +16,7 @@ along with this program. If not, see . */ #include +#include #include const char stub[] = { diff --git a/gdb/testsuite/gdb.base/attach-twice.c b/gdb/testsuite/gdb.base/attach-twice.c index 74ee33268d4..efe14f06025 100644 --- a/gdb/testsuite/gdb.base/attach-twice.c +++ b/gdb/testsuite/gdb.base/attach-twice.c @@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include #include #include #include diff --git a/gdb/testsuite/gdb.base/break-interp-lib.c b/gdb/testsuite/gdb.base/break-interp-lib.c index 314dc6659c3..0df29343384 100644 --- a/gdb/testsuite/gdb.base/break-interp-lib.c +++ b/gdb/testsuite/gdb.base/break-interp-lib.c @@ -19,6 +19,7 @@ #include #include #include +#include /* Force REL->RELA conversion on i386, see "Prelink", March 4, 2004. */ volatile int v[2]; diff --git a/gdb/testsuite/gdb.base/call-sc.c b/gdb/testsuite/gdb.base/call-sc.c index 56c18da3844..98c0229c85f 100644 --- a/gdb/testsuite/gdb.base/call-sc.c +++ b/gdb/testsuite/gdb.base/call-sc.c @@ -46,7 +46,7 @@ void Fun(T foo) L = foo; } -zed () +void zed () { L = 'Z'; } diff --git a/gdb/testsuite/gdb.base/catch-signal-fork.c b/gdb/testsuite/gdb.base/catch-signal-fork.c index 87fe417ca62..5ae83d641b7 100644 --- a/gdb/testsuite/gdb.base/catch-signal-fork.c +++ b/gdb/testsuite/gdb.base/catch-signal-fork.c @@ -14,8 +14,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include #include #include +#include #include void diff --git a/gdb/testsuite/gdb.base/checkpoint.c b/gdb/testsuite/gdb.base/checkpoint.c index b6f7ecd9fa6..8f9d6da526a 100644 --- a/gdb/testsuite/gdb.base/checkpoint.c +++ b/gdb/testsuite/gdb.base/checkpoint.c @@ -17,10 +17,11 @@ #include #include +#include long lines = 0; -main() +int main() { char linebuf[128]; FILE *in, *out; @@ -34,7 +35,7 @@ main() if (!in || !out) { fprintf (stderr, "File open failed\n"); - exit (1); + return 1; } for (i = 0; ; i++) @@ -55,5 +56,5 @@ main() fclose (out); printf ("Deleting copy.\n"); /* breakpoint 3 */ unlink (COPY1_TXT); - exit (0); /* breakpoint 4 */ + return 0; /* breakpoint 4 */ } diff --git a/gdb/testsuite/gdb.base/code_elim2.c b/gdb/testsuite/gdb.base/code_elim2.c index 64ecc04df60..875228ae338 100644 --- a/gdb/testsuite/gdb.base/code_elim2.c +++ b/gdb/testsuite/gdb.base/code_elim2.c @@ -19,12 +19,6 @@ int my_global_symbol = 42; static int my_static_symbol; -int -main () -{ - return my_global_func (); -} - int my_global_func () { @@ -32,3 +26,9 @@ my_global_func () my_global_symbol = my_static_symbol + my_global_symbol; return my_global_symbol; } + +int +main () +{ + return my_global_func (); +} diff --git a/gdb/testsuite/gdb.base/coremaker.c b/gdb/testsuite/gdb.base/coremaker.c index f05a111921f..22c14427adc 100644 --- a/gdb/testsuite/gdb.base/coremaker.c +++ b/gdb/testsuite/gdb.base/coremaker.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifndef __STDC__ #define const /**/ diff --git a/gdb/testsuite/gdb.base/dprintf-non-stop.c b/gdb/testsuite/gdb.base/dprintf-non-stop.c index 23c55fac129..c7eeca9ac2f 100644 --- a/gdb/testsuite/gdb.base/dprintf-non-stop.c +++ b/gdb/testsuite/gdb.base/dprintf-non-stop.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + void foo () { diff --git a/gdb/testsuite/gdb.base/dump.c b/gdb/testsuite/gdb.base/dump.c index bc68778ee7a..bdcafbffe0e 100644 --- a/gdb/testsuite/gdb.base/dump.c +++ b/gdb/testsuite/gdb.base/dump.c @@ -27,6 +27,7 @@ zero_all () memset ((char *) &intstruct2, 0, sizeof (intstruct2)); } +int main() { int i; @@ -43,4 +44,5 @@ main() intstruct.g = 12 * 7; checkpoint1 (); + return 0; } diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c index 29c32e00439..e44317344a2 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -9,6 +9,7 @@ #include #include #include +#include /* TESTS : * - open(const char *pathname, int flags, mode_t mode); 1) Attempt to create file that already exists - EEXIST diff --git a/gdb/testsuite/gdb.base/gcore.c b/gdb/testsuite/gdb.base/gcore.c index ee826a5048a..f74516d3b23 100644 --- a/gdb/testsuite/gdb.base/gcore.c +++ b/gdb/testsuite/gdb.base/gcore.c @@ -58,6 +58,7 @@ int factorial_func (int value) return (value); } +int main() { factorial_func (6); diff --git a/gdb/testsuite/gdb.base/global-var-nested-by-dso.c b/gdb/testsuite/gdb.base/global-var-nested-by-dso.c index 3b6309694ea..a77b8c29a00 100644 --- a/gdb/testsuite/gdb.base/global-var-nested-by-dso.c +++ b/gdb/testsuite/gdb.base/global-var-nested-by-dso.c @@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +extern void b_main (void); +extern void c_main (void); + int main (int argc, char *argv[]) { diff --git a/gdb/testsuite/gdb.base/huge.c b/gdb/testsuite/gdb.base/huge.c index 27ba04eb2ca..57727e9f9f8 100644 --- a/gdb/testsuite/gdb.base/huge.c +++ b/gdb/testsuite/gdb.base/huge.c @@ -12,6 +12,7 @@ #endif static int a[CRASH_GDB], b[CRASH_GDB]; +int main() { memcpy (a, b, sizeof (a)); diff --git a/gdb/testsuite/gdb.base/inferior-died.c b/gdb/testsuite/gdb.base/inferior-died.c index 5c4c5b242d4..bb635c00349 100644 --- a/gdb/testsuite/gdb.base/inferior-died.c +++ b/gdb/testsuite/gdb.base/inferior-died.c @@ -17,6 +17,7 @@ #include #include +#include #include void function(void) diff --git a/gdb/testsuite/gdb.base/info-os.c b/gdb/testsuite/gdb.base/info-os.c index 1a523480e60..23257d4ba67 100644 --- a/gdb/testsuite/gdb.base/info-os.c +++ b/gdb/testsuite/gdb.base/info-os.c @@ -22,6 +22,7 @@ #include #include #include +#include static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; diff --git a/gdb/testsuite/gdb.base/multi-forks.c b/gdb/testsuite/gdb.base/multi-forks.c index c090c57b4c0..bbe06c3a6a3 100644 --- a/gdb/testsuite/gdb.base/multi-forks.c +++ b/gdb/testsuite/gdb.base/multi-forks.c @@ -22,6 +22,7 @@ pid_t pids[4]; +int main() { int i; @@ -32,5 +33,5 @@ main() printf ("%d ready\n", getpid ()); sleep (2); printf ("%d done\n", getpid ()); - exit (0); /* Set exit breakpoint here. */ + return 0; /* Set exit breakpoint here. */ } diff --git a/gdb/testsuite/gdb.base/pr10179-a.c b/gdb/testsuite/gdb.base/pr10179-a.c index de5dcdeb031..56bce9df92e 100644 --- a/gdb/testsuite/gdb.base/pr10179-a.c +++ b/gdb/testsuite/gdb.base/pr10179-a.c @@ -12,6 +12,7 @@ bar1() { } +int main() { } diff --git a/gdb/testsuite/gdb.base/savedregs.c b/gdb/testsuite/gdb.base/savedregs.c index b88678729af..7b93b9ba018 100644 --- a/gdb/testsuite/gdb.base/savedregs.c +++ b/gdb/testsuite/gdb.base/savedregs.c @@ -61,9 +61,11 @@ thrower (void) } +int main () { signal (SIGILL, catcher); signal (SIGSEGV, catcher); thrower (); + return 0; } diff --git a/gdb/testsuite/gdb.base/sigaltstack.c b/gdb/testsuite/gdb.base/sigaltstack.c index 338501bdf39..2ee1b1d23f0 100644 --- a/gdb/testsuite/gdb.base/sigaltstack.c +++ b/gdb/testsuite/gdb.base/sigaltstack.c @@ -72,6 +72,7 @@ catcher (int signal) } +int main () { /* Set up the altstack. */ @@ -90,4 +91,5 @@ main () } level = MAIN; catcher (0); + return 0; } diff --git a/gdb/testsuite/gdb.base/siginfo.c b/gdb/testsuite/gdb.base/siginfo.c index 518083cc1ad..041102febcb 100644 --- a/gdb/testsuite/gdb.base/siginfo.c +++ b/gdb/testsuite/gdb.base/siginfo.c @@ -38,6 +38,7 @@ handler (int sig) } /* handler */ #endif +int main () { /* Set up the signal handler. */ diff --git a/gdb/testsuite/gdb.base/skip-solib-lib.c b/gdb/testsuite/gdb.base/skip-solib-lib.c index 792cd01b6b6..b2c4d86d703 100644 --- a/gdb/testsuite/gdb.base/skip-solib-lib.c +++ b/gdb/testsuite/gdb.base/skip-solib-lib.c @@ -1,11 +1,11 @@ /* Simple shared library */ -int square(int num) +int multiply(int a, int b) { - return multiply(num, num); + return a * b; } -int multiply(int a, int b) +int square(int num) { - return a * b; + return multiply(num, num); } diff --git a/gdb/testsuite/gdb.base/solib-weak.c b/gdb/testsuite/gdb.base/solib-weak.c index f54ea3d71d4..c1ee8d4fe48 100644 --- a/gdb/testsuite/gdb.base/solib-weak.c +++ b/gdb/testsuite/gdb.base/solib-weak.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +extern void foo (void); + int main() { diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c index 1fb4250f277..1f45239af2f 100644 --- a/gdb/testsuite/gdb.base/structs.c +++ b/gdb/testsuite/gdb.base/structs.c @@ -266,6 +266,7 @@ void Fun18(struct struct18 foo18) L18 = foo18; } +void zed () { diff --git a/gdb/testsuite/gdb.base/testenv.c b/gdb/testsuite/gdb.base/testenv.c index ef8035a7dcc..3eb9dd44069 100644 --- a/gdb/testsuite/gdb.base/testenv.c +++ b/gdb/testsuite/gdb.base/testenv.c @@ -22,6 +22,7 @@ inferior environment list. */ #include +#include int main (int argc, char **argv, char **envp) diff --git a/gdb/testsuite/gdb.base/weaklib1.c b/gdb/testsuite/gdb.base/weaklib1.c index 95360ac20a8..8782be14c5f 100644 --- a/gdb/testsuite/gdb.base/weaklib1.c +++ b/gdb/testsuite/gdb.base/weaklib1.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + void __attribute__((weak)) bar (void) { diff --git a/gdb/testsuite/gdb.base/weaklib2.c b/gdb/testsuite/gdb.base/weaklib2.c index ecd8321b06e..b6458c04221 100644 --- a/gdb/testsuite/gdb.base/weaklib2.c +++ b/gdb/testsuite/gdb.base/weaklib2.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + void bar (void); void foo (void) diff --git a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c index e9ca92d6cf9..a466c549172 100644 --- a/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c +++ b/gdb/testsuite/gdb.mi/mi-condbreak-call-thr-state-mt.c @@ -19,6 +19,8 @@ #include #include +#include +#include extern int test (void); diff --git a/gdb/testsuite/gdb.mi/mi-console.c b/gdb/testsuite/gdb.mi/mi-console.c index 0cd2243c4f2..5ca046f52d4 100644 --- a/gdb/testsuite/gdb.mi/mi-console.c +++ b/gdb/testsuite/gdb.mi/mi-console.c @@ -1,3 +1,5 @@ +#include + void hello () { diff --git a/gdb/testsuite/gdb.mi/mi-exit-code.c b/gdb/testsuite/gdb.mi/mi-exit-code.c index df711a6a4e5..47bf15c6046 100644 --- a/gdb/testsuite/gdb.mi/mi-exit-code.c +++ b/gdb/testsuite/gdb.mi/mi-exit-code.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/>. */ +#include + int exit_code = 0; int diff --git a/gdb/testsuite/gdb.mi/mi-stack.c b/gdb/testsuite/gdb.mi/mi-stack.c index 5f2452c17b9..d41f9a08f4e 100644 --- a/gdb/testsuite/gdb.mi/mi-stack.c +++ b/gdb/testsuite/gdb.mi/mi-stack.c @@ -32,22 +32,23 @@ int callee4 (void) C = A + B; return 0; } -callee3 (char *strarg) + +void callee3 (char *strarg) { callee4 (); } -callee2 (int intarg, char *strarg) +void callee2 (int intarg, char *strarg) { callee3 (strarg); } -callee1 (int intarg, char *strarg, double fltarg) +void callee1 (int intarg, char *strarg, double fltarg) { callee2 (intarg, strarg); } -main () +int main () { callee1 (2, "A string argument.", 3.5); callee1 (2, "A string argument.", 3.5); diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c index 332f246a788..c260112b3fd 100644 --- a/gdb/testsuite/gdb.mi/mi-syn-frame.c +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c @@ -9,12 +9,14 @@ void subroutine (int); void handler (int); void have_a_very_merry_interrupt (void); +int main () { foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */ have_a_very_merry_interrupt (); + return 0; } void diff --git a/gdb/testsuite/gdb.mi/until.c b/gdb/testsuite/gdb.mi/until.c index df4a68d930f..21bdedaf3e6 100644 --- a/gdb/testsuite/gdb.mi/until.c +++ b/gdb/testsuite/gdb.mi/until.c @@ -1,3 +1,4 @@ +void foo (void) { int i, x, y, z; @@ -17,6 +18,7 @@ foo (void) y = 10; } +int main () { int a = 1; diff --git a/gdb/testsuite/gdb.mi/watch-nonstop.c b/gdb/testsuite/gdb.mi/watch-nonstop.c index 3f8a18c0543..ea4406bb385 100644 --- a/gdb/testsuite/gdb.mi/watch-nonstop.c +++ b/gdb/testsuite/gdb.mi/watch-nonstop.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + int global; int main () diff --git a/gdb/testsuite/gdb.python/py-events.c b/gdb/testsuite/gdb.python/py-events.c index 17e9f21adc6..2dabdbdb8fd 100644 --- a/gdb/testsuite/gdb.python/py-events.c +++ b/gdb/testsuite/gdb.python/py-events.c @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + extern void do_nothing (void); int second(){ diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.c b/gdb/testsuite/gdb.python/py-finish-breakpoint.c index 0eda8b93a5a..5c8663ab86f 100644 --- a/gdb/testsuite/gdb.python/py-finish-breakpoint.c +++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.c @@ -17,6 +17,7 @@ #include #include +#include #include /* Defined in py-events-shlib.h. */ -- 2.30.2