From patchwork Fri Oct 4 14:24:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 34827 Received: (qmail 106792 invoked by alias); 4 Oct 2019 14:24:34 -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 106742 invoked by uid 89); 4 Oct 2019 14:24:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:local-static.exp, 4.8, sk:local-s, sk:locals X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Oct 2019 14:24:29 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 434B1AD22 for ; Fri, 4 Oct 2019 14:24:27 +0000 (UTC) Date: Fri, 4 Oct 2019 16:24:25 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix local-static.exp with gcc-4.8 Message-ID: <20191004142424.GA11065@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, With gdb.cp/local-static.exp and gcc 4.8, I see: ... gdb compile failed, src/gdb/testsuite/gdb.cp/local-static.c: In function 'main': src/gdb/testsuite/gdb.cp/local-static.c:148:3: error: 'for' loop initial \ declarations are only allowed in C99 mode for (int i = 0; i < 1000; i++) ^ src/gdb/testsuite/gdb.cp/local-static.c:148:3: note: use option -std=c99 or \ -std=gnu99 to compile your code UNTESTED: gdb.cp/local-static.exp: c: failed to prepare ... Fix this by moving the declaration of int i out of the for loop. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix local-static.exp with gcc-4.8 gdb/testsuite/ChangeLog: 2019-10-04 Tom de Vries * gdb.cp/local-static.c (main): Move declaration of int i out of the for loop. --- gdb/testsuite/gdb.cp/local-static.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/local-static.c b/gdb/testsuite/gdb.cp/local-static.c index 33ab2e352d2..6d9c368c87b 100644 --- a/gdb/testsuite/gdb.cp/local-static.c +++ b/gdb/testsuite/gdb.cp/local-static.c @@ -145,7 +145,9 @@ free_inline_func (void) int main () { - for (int i = 0; i < 1000; i++) + int i; + + for (i = 0; i < 1000; i++) { free_func (); free_inline_func ();