From patchwork Fri Jan 8 18:55:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 10302 Received: (qmail 83576 invoked by alias); 8 Jan 2016 18:55:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 83559 invoked by uid 89); 8 Jan 2016 18:55:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 spammy=176, reordering, check-in, 3928 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 Jan 2016 18:55:19 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 8958F19F26F for ; Fri, 8 Jan 2016 18:55:18 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-99.ams2.redhat.com [10.36.116.99]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u08ItFrt007111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Jan 2016 13:55:17 -0500 Date: Fri, 8 Jan 2016 19:55:14 +0100 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: [testsuite patch] Fix gdb.multi/base.exp testsuite regression [Re: [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/] Message-ID: <20160108185514.GA26527@host1.jankratochvil.net> References: <1449765071-32101-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1449765071-32101-1-git-send-email-palves@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes On Thu, 10 Dec 2015 17:31:11 +0100, Pedro Alves wrote: > Several of the gdb.multi tests use the "nowarnings" option to suppress > warnings. 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 OK for check-in? Jan 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. diff --git a/gdb/testsuite/gdb.multi/goodbye.c b/gdb/testsuite/gdb.multi/goodbye.c index 701e504..bf7759a 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 e2c41b8..3701512 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 efff59d..93d921f 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;