From: Pedro Alves Date: Sun, 13 Sep 2020 21:47:01 +0000 (+0100) Subject: gdb/testsuite: Explicitly return from main X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc3a371e83b6df36beb8c6d12a07d3e469b68a36;p=binutils-gdb.git gdb/testsuite: Explicitly return from main I've been playing with a board file that forces every testcase to include a header file that does something like: #define main __gdb_testcase_main and then links an actual main() function that does some initialization and then jumps to __gdb_testcase_main. That runs into a number of testcases relying on main not having an explicit return statement, like e.g.,: gdb/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.base/catch-follow-exec.c:27:1: warning: non-void function does not return a value [-Wreturn-type] gdb/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.base/catch-signal.c:47:1: warning: non-void function does not return a value [-Wreturn-type] We don't get those warnings without my board because it is valid to not explicitly return from main. There's an implicit "return 0;". Since it doesn't hurt to be explicit, I've went ahead and added the explicit return statements. Also, a couple testcases either don't explicitly specify main's return type, or return void. Those are tweaked to explicitly return int. gdb/testsuite/ChangeLog: * gdb.base/catch-follow-exec.c (main): Add explicit return statement. * gdb.base/catch-signal.c (main): Likewise. * gdb.base/condbreak-call-false.c (main): Likewise. * gdb.base/consecutive.c (main): Add explicit return statement and return type. * gdb.base/cursal.c (main): Add explicit return statement. * gdb.base/cvexpr.c (main): Likewise. * gdb.base/display.c (main): Add explicit return statement and return type. * gdb.base/dprintf-detach.c (main): Add explicit return statement. * gdb.base/endianity.c (main): Likewise. * gdb.base/execd-prog.c (main): Likewise. * gdb.base/gdb1090.c (main): Likewise. * gdb.base/info_qt.c (main): Likewise. * gdb.base/lineinc.c (main): Likewise. * gdb.base/load-command.c (main): Likewise. * gdb.base/macscp1.c (main): Likewise. * gdb.base/pr10179-a.c (main): Likewise. * gdb.base/quit-live.c (main): Likewise. * gdb.base/scope0.c (main): Likewise. * gdb.base/settings.c (main): Likewise. * gdb.base/stack-checking.c (main): Return int. * gdb.base/varargs.c (main): Add explicit return statement. * gdb.cp/ambiguous.cc (main): Likewise. * gdb.cp/anon-struct.cc (main): Likewise. * gdb.cp/anon-union.cc (main): Likewise. * gdb.cp/bool.cc (main): Likewise. * gdb.cp/bs15503.cc (main): Likewise. * gdb.cp/cplusfuncs.cc (main): Likewise. * gdb.cp/cttiadd.cc (main): Likewise. * gdb.cp/extern-c.cc (main): Likewise. * gdb.cp/filename.cc (main): Likewise. * gdb.cp/formatted-ref.cc (main): Likewise. * gdb.cp/mb-ctor.cc (main): Likewise. * gdb.cp/member-ptr.cc (main): Likewise. * gdb.cp/minsym-fallback-main.cc (main): Likewise. * gdb.cp/overload-const.cc (main): Likewise. * gdb.cp/paren-type.cc (main): Likewise. * gdb.cp/parse-lang.cc (main): Likewise. * gdb.cp/pr-1023.cc (main): Likewise. * gdb.cp/psmang1.cc (main): Likewise. * gdb.cp/readnow-language.cc (main): Likewise. * gdb.cp/ref-params.cc (main): Likewise. * gdb.cp/rvalue-ref-params.cc (main): Likewise. * gdb.cp/virtbase2.cc (main): Likewise. * gdb.dwarf2/dw2-abs-hi-pc.c (main): Likewise. * gdb.dwarf2/dw2-namespaceless-anonymous.c (main): Likewise. * gdb.dwarf2/dw4-toplevel-types.cc (main): Likewise. * gdb.mi/mi-console.c (main): Likewise. * gdb.mi/mi-read-memory.c (main): Likewise. * gdb.modula2/multidim.c (main): Likewise. * gdb.opt/inline-small-func.c (main): Likewise. * gdb.python/py-rbreak.c (main): Likewise. * gdb.stabs/exclfwd1.c (main): Likewise. * gdb.trace/qtro.c (main): Likewise. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5c37401dd2f..230def43580 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,62 @@ +2020-09-13 Pedro Alves + + * gdb.base/catch-follow-exec.c (main): Add explicit return + statement. + * gdb.base/catch-signal.c (main): Likewise. + * gdb.base/condbreak-call-false.c (main): Likewise. + * gdb.base/consecutive.c (main): Add explicit return + statement and return type. + * gdb.base/cursal.c (main): Add explicit return statement. + * gdb.base/cvexpr.c (main): Likewise. + * gdb.base/display.c (main): Add explicit return statement and + return type. + * gdb.base/dprintf-detach.c (main): Add explicit return statement. + * gdb.base/endianity.c (main): Likewise. + * gdb.base/execd-prog.c (main): Likewise. + * gdb.base/gdb1090.c (main): Likewise. + * gdb.base/info_qt.c (main): Likewise. + * gdb.base/lineinc.c (main): Likewise. + * gdb.base/load-command.c (main): Likewise. + * gdb.base/macscp1.c (main): Likewise. + * gdb.base/pr10179-a.c (main): Likewise. + * gdb.base/quit-live.c (main): Likewise. + * gdb.base/scope0.c (main): Likewise. + * gdb.base/settings.c (main): Likewise. + * gdb.base/stack-checking.c (main): Return int. + * gdb.base/varargs.c (main): Add explicit return statement. + * gdb.cp/ambiguous.cc (main): Likewise. + * gdb.cp/anon-struct.cc (main): Likewise. + * gdb.cp/anon-union.cc (main): Likewise. + * gdb.cp/bool.cc (main): Likewise. + * gdb.cp/bs15503.cc (main): Likewise. + * gdb.cp/cplusfuncs.cc (main): Likewise. + * gdb.cp/cttiadd.cc (main): Likewise. + * gdb.cp/extern-c.cc (main): Likewise. + * gdb.cp/filename.cc (main): Likewise. + * gdb.cp/formatted-ref.cc (main): Likewise. + * gdb.cp/mb-ctor.cc (main): Likewise. + * gdb.cp/member-ptr.cc (main): Likewise. + * gdb.cp/minsym-fallback-main.cc (main): Likewise. + * gdb.cp/overload-const.cc (main): Likewise. + * gdb.cp/paren-type.cc (main): Likewise. + * gdb.cp/parse-lang.cc (main): Likewise. + * gdb.cp/pr-1023.cc (main): Likewise. + * gdb.cp/psmang1.cc (main): Likewise. + * gdb.cp/readnow-language.cc (main): Likewise. + * gdb.cp/ref-params.cc (main): Likewise. + * gdb.cp/rvalue-ref-params.cc (main): Likewise. + * gdb.cp/virtbase2.cc (main): Likewise. + * gdb.dwarf2/dw2-abs-hi-pc.c (main): Likewise. + * gdb.dwarf2/dw2-namespaceless-anonymous.c (main): Likewise. + * gdb.dwarf2/dw4-toplevel-types.cc (main): Likewise. + * gdb.mi/mi-console.c (main): Likewise. + * gdb.mi/mi-read-memory.c (main): Likewise. + * gdb.modula2/multidim.c (main): Likewise. + * gdb.opt/inline-small-func.c (main): Likewise. + * gdb.python/py-rbreak.c (main): Likewise. + * gdb.stabs/exclfwd1.c (main): Likewise. + * gdb.trace/qtro.c (main): Likewise. + 2020-09-13 Pedro Alves * gdb.base/share-env-with-gdbserver.c (main): Call my_getenv diff --git a/gdb/testsuite/gdb.base/catch-follow-exec.c b/gdb/testsuite/gdb.base/catch-follow-exec.c index 3168b02b217..1e33adc060d 100644 --- a/gdb/testsuite/gdb.base/catch-follow-exec.c +++ b/gdb/testsuite/gdb.base/catch-follow-exec.c @@ -24,4 +24,6 @@ main (void) { char *exec_args[] = { "/bin/ls", "ppp", NULL }; execve (exec_args[0], exec_args, NULL); + + return 0; } diff --git a/gdb/testsuite/gdb.base/catch-signal.c b/gdb/testsuite/gdb.base/catch-signal.c index ecec9fe2419..e6c6d5673d1 100644 --- a/gdb/testsuite/gdb.base/catch-signal.c +++ b/gdb/testsuite/gdb.base/catch-signal.c @@ -44,5 +44,7 @@ main () raise (SIGHUP); /* fourth HUP */ raise (SIGINT); /* first INT */ + + return 0; } diff --git a/gdb/testsuite/gdb.base/condbreak-call-false.c b/gdb/testsuite/gdb.base/condbreak-call-false.c index 2d6112e68d2..92e116444ff 100644 --- a/gdb/testsuite/gdb.base/condbreak-call-false.c +++ b/gdb/testsuite/gdb.base/condbreak-call-false.c @@ -36,4 +36,6 @@ main (void) { foo (); bar (); + + return 0; } diff --git a/gdb/testsuite/gdb.base/consecutive.c b/gdb/testsuite/gdb.base/consecutive.c index 7d0cea942ad..869a88c911f 100644 --- a/gdb/testsuite/gdb.base/consecutive.c +++ b/gdb/testsuite/gdb.base/consecutive.c @@ -10,7 +10,9 @@ int foo () return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6]; } -main() +int +main () { foo (); + return 0; } diff --git a/gdb/testsuite/gdb.base/cursal.c b/gdb/testsuite/gdb.base/cursal.c index 9e149828f36..3c3ba727154 100644 --- a/gdb/testsuite/gdb.base/cursal.c +++ b/gdb/testsuite/gdb.base/cursal.c @@ -34,4 +34,6 @@ main () { int v0 = 0; func1 (); + + return 0; } diff --git a/gdb/testsuite/gdb.base/cvexpr.c b/gdb/testsuite/gdb.base/cvexpr.c index 042c3319ac9..9cfdd909e97 100644 --- a/gdb/testsuite/gdb.base/cvexpr.c +++ b/gdb/testsuite/gdb.base/cvexpr.c @@ -427,4 +427,6 @@ int main () use (&v_float_func); use (&v_double_func); + + return 0; } diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c index cd833e20d9c..67f205af0cd 100644 --- a/gdb/testsuite/gdb.base/display.c +++ b/gdb/testsuite/gdb.base/display.c @@ -50,8 +50,10 @@ int do_vars() return *p_i; } +int main() { do_loops(); do_vars(); + return 0; } diff --git a/gdb/testsuite/gdb.base/dprintf-detach.c b/gdb/testsuite/gdb.base/dprintf-detach.c index 8b0fe3eae9c..9728c87b006 100644 --- a/gdb/testsuite/gdb.base/dprintf-detach.c +++ b/gdb/testsuite/gdb.base/dprintf-detach.c @@ -30,4 +30,6 @@ main (void) for (i = 0; i < 30; i++) function (); + + return 0; } diff --git a/gdb/testsuite/gdb.base/endianity.c b/gdb/testsuite/gdb.base/endianity.c index a376a585ed4..ef3b6d4fdb2 100644 --- a/gdb/testsuite/gdb.base/endianity.c +++ b/gdb/testsuite/gdb.base/endianity.c @@ -46,4 +46,6 @@ main (void) struct otherendian o = {3, 2, 7, 23.5, 1.25 + 7.25i, 75}; do_nothing (&o); /* START */ + + return 0; } diff --git a/gdb/testsuite/gdb.base/execd-prog.c b/gdb/testsuite/gdb.base/execd-prog.c index ac9928fd823..39cb210e076 100644 --- a/gdb/testsuite/gdb.base/execd-prog.c +++ b/gdb/testsuite/gdb.base/execd-prog.c @@ -25,4 +25,6 @@ int main (int argc, char **argv) } s = argv[1]; printf ("argument received: %s\n", s); + + return 0; } diff --git a/gdb/testsuite/gdb.base/gdb1090.c b/gdb/testsuite/gdb.base/gdb1090.c index 453f98f6beb..cb8fb76946f 100644 --- a/gdb/testsuite/gdb.base/gdb1090.c +++ b/gdb/testsuite/gdb.base/gdb1090.c @@ -43,4 +43,6 @@ void foo () int main () { foo (); + + return 0; } diff --git a/gdb/testsuite/gdb.base/info_qt.c b/gdb/testsuite/gdb.base/info_qt.c index 2a3893e8d1d..10c011dedb0 100644 --- a/gdb/testsuite/gdb.base/info_qt.c +++ b/gdb/testsuite/gdb.base/info_qt.c @@ -75,4 +75,6 @@ main (int argc, char **argv, char **envp) (void) info_fun2bis ('b'); (void) info_fun2xxx ('c', 1, 2); (void) info_fun2yyy ('d', 3, 4); + + return 0; } diff --git a/gdb/testsuite/gdb.base/lineinc.c b/gdb/testsuite/gdb.base/lineinc.c index 91784e7d2b3..655ba54613f 100644 --- a/gdb/testsuite/gdb.base/lineinc.c +++ b/gdb/testsuite/gdb.base/lineinc.c @@ -27,4 +27,5 @@ int main (int argc, char **argv) { + return 0; } diff --git a/gdb/testsuite/gdb.base/load-command.c b/gdb/testsuite/gdb.base/load-command.c index d185f27e907..15d6de32749 100644 --- a/gdb/testsuite/gdb.base/load-command.c +++ b/gdb/testsuite/gdb.base/load-command.c @@ -19,4 +19,5 @@ int the_variable = 0x1234; int main () { + return 0; } diff --git a/gdb/testsuite/gdb.base/macscp1.c b/gdb/testsuite/gdb.base/macscp1.c index 09a4c0dd182..a42666e8ea6 100644 --- a/gdb/testsuite/gdb.base/macscp1.c +++ b/gdb/testsuite/gdb.base/macscp1.c @@ -111,4 +111,6 @@ main (int argc, char **argv) macscp3_2 (); macscp1_3 (); macscp_expr (); + + return 0; } diff --git a/gdb/testsuite/gdb.base/pr10179-a.c b/gdb/testsuite/gdb.base/pr10179-a.c index 584b1bc32a4..1d67d07bbb0 100644 --- a/gdb/testsuite/gdb.base/pr10179-a.c +++ b/gdb/testsuite/gdb.base/pr10179-a.c @@ -17,4 +17,5 @@ bar1() int main() { + return 0; } diff --git a/gdb/testsuite/gdb.base/quit-live.c b/gdb/testsuite/gdb.base/quit-live.c index aa0a7a2ef12..bbbef6efc93 100644 --- a/gdb/testsuite/gdb.base/quit-live.c +++ b/gdb/testsuite/gdb.base/quit-live.c @@ -24,4 +24,6 @@ main () while (secs--) sleep (1); + + return 0; } diff --git a/gdb/testsuite/gdb.base/scope0.c b/gdb/testsuite/gdb.base/scope0.c index e7f4724b74d..3aad48de2d7 100644 --- a/gdb/testsuite/gdb.base/scope0.c +++ b/gdb/testsuite/gdb.base/scope0.c @@ -24,6 +24,8 @@ int main () foo (); autovars (5, 6); localscopes (0); + + return 0; } /* On some systems, such as AIX, unreferenced variables are deleted diff --git a/gdb/testsuite/gdb.base/settings.c b/gdb/testsuite/gdb.base/settings.c index 204224ecae1..e9eeb28b94f 100644 --- a/gdb/testsuite/gdb.base/settings.c +++ b/gdb/testsuite/gdb.base/settings.c @@ -20,4 +20,5 @@ int xxx1= 123; int main () { + return 0; } diff --git a/gdb/testsuite/gdb.base/stack-checking.c b/gdb/testsuite/gdb.base/stack-checking.c index e11b5c40725..772ce900d1b 100644 --- a/gdb/testsuite/gdb.base/stack-checking.c +++ b/gdb/testsuite/gdb.base/stack-checking.c @@ -40,10 +40,11 @@ void big_frame () small_frame (); } -void +int main () { small_frame (); medium_frame (); big_frame (); + return 0; } diff --git a/gdb/testsuite/gdb.base/varargs.c b/gdb/testsuite/gdb.base/varargs.c index 4c0f16547f4..cacb29d89e7 100644 --- a/gdb/testsuite/gdb.base/varargs.c +++ b/gdb/testsuite/gdb.base/varargs.c @@ -79,6 +79,8 @@ main (void) { gdb_unbuffer_output (); test (); + + return 0; } /* Integer varargs, 1 declared arg */ diff --git a/gdb/testsuite/gdb.cp/ambiguous.cc b/gdb/testsuite/gdb.cp/ambiguous.cc index 6ee7bc18ea9..93fba1c1e98 100644 --- a/gdb/testsuite/gdb.cp/ambiguous.cc +++ b/gdb/testsuite/gdb.cp/ambiguous.cc @@ -103,8 +103,6 @@ int main() i += k.i + m.w + a1.x + a2.x + a3.x + x.z + l.z + n.r + j.j; marker1(); - -} - - + return 0; +} diff --git a/gdb/testsuite/gdb.cp/anon-struct.cc b/gdb/testsuite/gdb.cp/anon-struct.cc index 5bcfaf2cef9..0460425ff0e 100644 --- a/gdb/testsuite/gdb.cp/anon-struct.cc +++ b/gdb/testsuite/gdb.cp/anon-struct.cc @@ -54,4 +54,5 @@ t3 v3; int main() { + return 0; } diff --git a/gdb/testsuite/gdb.cp/anon-union.cc b/gdb/testsuite/gdb.cp/anon-union.cc index fa75251778a..2a2a1c5ebb9 100644 --- a/gdb/testsuite/gdb.cp/anon-union.cc +++ b/gdb/testsuite/gdb.cp/anon-union.cc @@ -53,4 +53,6 @@ int main() w = 45; int j = 0; + + return 0; } diff --git a/gdb/testsuite/gdb.cp/bool.cc b/gdb/testsuite/gdb.cp/bool.cc index c6860a4109b..9144380c906 100644 --- a/gdb/testsuite/gdb.cp/bool.cc +++ b/gdb/testsuite/gdb.cp/bool.cc @@ -34,4 +34,6 @@ main () { return_true (); return_false (); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/bs15503.cc b/gdb/testsuite/gdb.cp/bs15503.cc index dae047916dd..4a135783762 100644 --- a/gdb/testsuite/gdb.cp/bs15503.cc +++ b/gdb/testsuite/gdb.cp/bs15503.cc @@ -59,6 +59,8 @@ void StringTest ::testFunction() { int main() { StringTest ts; ts.runTest(); + + return 0; } /* output: diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.cc b/gdb/testsuite/gdb.cp/cplusfuncs.cc index 021d7c11dad..7d2e27442f3 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.cc +++ b/gdb/testsuite/gdb.cp/cplusfuncs.cc @@ -60,6 +60,8 @@ public: int main () { int z=3; + + return 0; } foo::foo (int i) { ifoo = i;} diff --git a/gdb/testsuite/gdb.cp/cttiadd.cc b/gdb/testsuite/gdb.cp/cttiadd.cc index c7287664f71..0d417c7f551 100644 --- a/gdb/testsuite/gdb.cp/cttiadd.cc +++ b/gdb/testsuite/gdb.cp/cttiadd.cc @@ -44,4 +44,6 @@ int main() add1(); subr2(); subr3(); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/extern-c.cc b/gdb/testsuite/gdb.cp/extern-c.cc index 2260d713062..b03d53dcd0a 100644 --- a/gdb/testsuite/gdb.cp/extern-c.cc +++ b/gdb/testsuite/gdb.cp/extern-c.cc @@ -35,4 +35,6 @@ int main() c_func (); c_funcs_1 (); c_funcs_2 (); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/filename.cc b/gdb/testsuite/gdb.cp/filename.cc index 30aca72e509..834d4eac868 100644 --- a/gdb/testsuite/gdb.cp/filename.cc +++ b/gdb/testsuite/gdb.cp/filename.cc @@ -52,5 +52,5 @@ int main() { D* pd = &d; d.m(); - /* stop outside */ + return 0; /* stop outside */ } diff --git a/gdb/testsuite/gdb.cp/formatted-ref.cc b/gdb/testsuite/gdb.cp/formatted-ref.cc index 7f1cb37bb93..343293e5556 100644 --- a/gdb/testsuite/gdb.cp/formatted-ref.cc +++ b/gdb/testsuite/gdb.cp/formatted-ref.cc @@ -40,4 +40,5 @@ int main(void) f1 (s1, e1, i1); + return 0; } diff --git a/gdb/testsuite/gdb.cp/mb-ctor.cc b/gdb/testsuite/gdb.cp/mb-ctor.cc index c2992601a16..c54b4fece48 100644 --- a/gdb/testsuite/gdb.cp/mb-ctor.cc +++ b/gdb/testsuite/gdb.cp/mb-ctor.cc @@ -63,4 +63,6 @@ int main() Derived. Base is constructed separately by DeeplyDerived's ctor. */ DeeplyDerived dd(15); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/member-ptr.cc b/gdb/testsuite/gdb.cp/member-ptr.cc index a3780de9387..31ded586b72 100644 --- a/gdb/testsuite/gdb.cp/member-ptr.cc +++ b/gdb/testsuite/gdb.cp/member-ptr.cc @@ -230,4 +230,5 @@ int main () k += b.s; + return 0; } diff --git a/gdb/testsuite/gdb.cp/minsym-fallback-main.cc b/gdb/testsuite/gdb.cp/minsym-fallback-main.cc index 628fe783409..8263588e249 100644 --- a/gdb/testsuite/gdb.cp/minsym-fallback-main.cc +++ b/gdb/testsuite/gdb.cp/minsym-fallback-main.cc @@ -24,4 +24,6 @@ main () { c.f (); c (); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/overload-const.cc b/gdb/testsuite/gdb.cp/overload-const.cc index 255ed81f5ab..16c5f38e611 100644 --- a/gdb/testsuite/gdb.cp/overload-const.cc +++ b/gdb/testsuite/gdb.cp/overload-const.cc @@ -25,4 +25,6 @@ int main () { myclass::func (42); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/paren-type.cc b/gdb/testsuite/gdb.cp/paren-type.cc index 226d0032d4a..179bb10b6e1 100644 --- a/gdb/testsuite/gdb.cp/paren-type.cc +++ b/gdb/testsuite/gdb.cp/paren-type.cc @@ -30,4 +30,6 @@ int main () { C::f(1); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/parse-lang.cc b/gdb/testsuite/gdb.cp/parse-lang.cc index 50db4ac5416..14ecf57f514 100644 --- a/gdb/testsuite/gdb.cp/parse-lang.cc +++ b/gdb/testsuite/gdb.cp/parse-lang.cc @@ -37,4 +37,6 @@ main () c.m (); marker (); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/pr-1023.cc b/gdb/testsuite/gdb.cp/pr-1023.cc index 758308481dc..156f48612c8 100644 --- a/gdb/testsuite/gdb.cp/pr-1023.cc +++ b/gdb/testsuite/gdb.cp/pr-1023.cc @@ -16,5 +16,6 @@ int main () myClass mc; mc.performBlocking (0); mc.performUnblocking (0); -} + return 0; +} diff --git a/gdb/testsuite/gdb.cp/psmang1.cc b/gdb/testsuite/gdb.cp/psmang1.cc index 12d120f41c5..088f32d4ebe 100644 --- a/gdb/testsuite/gdb.cp/psmang1.cc +++ b/gdb/testsuite/gdb.cp/psmang1.cc @@ -37,6 +37,8 @@ main (int argc, char **argv) si.method1 (); si.method2 (); + + return 0; } diff --git a/gdb/testsuite/gdb.cp/readnow-language.cc b/gdb/testsuite/gdb.cp/readnow-language.cc index fcd79583c15..72f039a391b 100644 --- a/gdb/testsuite/gdb.cp/readnow-language.cc +++ b/gdb/testsuite/gdb.cp/readnow-language.cc @@ -18,4 +18,5 @@ int main () { + return 0; } diff --git a/gdb/testsuite/gdb.cp/ref-params.cc b/gdb/testsuite/gdb.cp/ref-params.cc index 5948001f567..e68418e6fd2 100644 --- a/gdb/testsuite/gdb.cp/ref-params.cc +++ b/gdb/testsuite/gdb.cp/ref-params.cc @@ -69,4 +69,6 @@ int main(void) MultiChild& MQR = MQ; mf2(MQ); /* Set breakpoint MQ here. */ + + return 0; } diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.cc b/gdb/testsuite/gdb.cp/rvalue-ref-params.cc index b23afbfa594..62caed96350 100644 --- a/gdb/testsuite/gdb.cp/rvalue-ref-params.cc +++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.cc @@ -80,4 +80,6 @@ main () MultiChild &MQR = MQ; mf2 (std::move (MQ)); /* Set breakpoint MQ here. */ + + return 0; } diff --git a/gdb/testsuite/gdb.cp/virtbase2.cc b/gdb/testsuite/gdb.cp/virtbase2.cc index 058484f715e..62f4d861697 100644 --- a/gdb/testsuite/gdb.cp/virtbase2.cc +++ b/gdb/testsuite/gdb.cp/virtbase2.cc @@ -46,4 +46,6 @@ int main() { derived().func_d(); foo().func_f(); + + return 0; } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.c b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.c index 9994ed5059a..4f0b81f621f 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc.c @@ -25,4 +25,6 @@ main (void) { hello (); world (); + + return 0; } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.c b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.c index 3c5e258090c..3d6b4a4c709 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.c @@ -19,4 +19,5 @@ char _ZN12_GLOBAL__N_11vE = 1; int main () { + return 0; } diff --git a/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc b/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc index c47598c46ef..da8e90bf951 100644 --- a/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc +++ b/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc @@ -18,4 +18,4 @@ struct X {} x; struct Y {} y; struct Z {} z; -int main() {} +int main() { return 0; } diff --git a/gdb/testsuite/gdb.mi/mi-console.c b/gdb/testsuite/gdb.mi/mi-console.c index 5ca046f52d4..ba634549047 100644 --- a/gdb/testsuite/gdb.mi/mi-console.c +++ b/gdb/testsuite/gdb.mi/mi-console.c @@ -13,4 +13,6 @@ int main () { hello (); -} /* after-hello */ + + return 0; /* after-hello */ +} diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.c b/gdb/testsuite/gdb.mi/mi-read-memory.c index 7a87c641856..27ae25e9e7d 100644 --- a/gdb/testsuite/gdb.mi/mi-read-memory.c +++ b/gdb/testsuite/gdb.mi/mi-read-memory.c @@ -17,4 +17,5 @@ int main () { initialize (); + return 0; } diff --git a/gdb/testsuite/gdb.modula2/multidim.c b/gdb/testsuite/gdb.modula2/multidim.c index b0ce8488681..e6c7934868b 100644 --- a/gdb/testsuite/gdb.modula2/multidim.c +++ b/gdb/testsuite/gdb.modula2/multidim.c @@ -36,4 +36,6 @@ main () count += 1; } here (); + + return 0; } diff --git a/gdb/testsuite/gdb.opt/inline-small-func.c b/gdb/testsuite/gdb.opt/inline-small-func.c index 902674e8773..bd79c3aea10 100644 --- a/gdb/testsuite/gdb.opt/inline-small-func.c +++ b/gdb/testsuite/gdb.opt/inline-small-func.c @@ -19,4 +19,5 @@ int main () { /* caller: before call. */ callee (); /* caller: the call. */ -} /* caller: after call. */ + return 0; /* caller: after call. */ +} diff --git a/gdb/testsuite/gdb.python/py-rbreak.c b/gdb/testsuite/gdb.python/py-rbreak.c index 1e02a426dd9..da28cffd67d 100644 --- a/gdb/testsuite/gdb.python/py-rbreak.c +++ b/gdb/testsuite/gdb.python/py-rbreak.c @@ -67,4 +67,6 @@ main() func5 (); func6 (); outside_scope (); + + return 0; } diff --git a/gdb/testsuite/gdb.stabs/exclfwd1.c b/gdb/testsuite/gdb.stabs/exclfwd1.c index a0642d0f7dd..ef536016e9d 100644 --- a/gdb/testsuite/gdb.stabs/exclfwd1.c +++ b/gdb/testsuite/gdb.stabs/exclfwd1.c @@ -30,4 +30,5 @@ a_t v1; int main () { + return 0; } diff --git a/gdb/testsuite/gdb.trace/qtro.c b/gdb/testsuite/gdb.trace/qtro.c index f9d7ea50a33..0c95f7c4c5d 100644 --- a/gdb/testsuite/gdb.trace/qtro.c +++ b/gdb/testsuite/gdb.trace/qtro.c @@ -30,4 +30,6 @@ main () { subr (1); end (); + + return 0; }