From patchwork Wed Apr 11 01:54:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 26682 Received: (qmail 101614 invoked by alias); 11 Apr 2018 01:54:11 -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 101597 invoked by uid 89); 11 Apr 2018 01:54:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=2170, 2.17.0 X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Apr 2018 01:54:08 +0000 X-ASG-Debug-ID: 1523411642-0c856e618994b3d0001-fS2M51 Received: from smtp.ebox.ca (smtp.electronicbox.net [96.127.255.82]) by barracuda.ebox.ca with ESMTP id fR2l8nAHgogGEfaA (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Apr 2018 21:54:02 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id 40596441B21; Tue, 10 Apr 2018 21:54:02 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 192-222-164-54.qc.cable.ebox.net[192.222.164.54] X-Barracuda-Apparent-Source-IP: 192.222.164.54 X-Barracuda-RBL-IP: 192.222.164.54 To: gdb-patches@sourceware.org Cc: omair.javaid@linaro.org, Simon Marchi Subject: [PATCH] Fix compilation failure in gdb.arch/aarch64-tagged-pointer.c Date: Tue, 10 Apr 2018 21:54:00 -0400 X-ASG-Orig-Subj: [PATCH] Fix compilation failure in gdb.arch/aarch64-tagged-pointer.c Message-Id: <20180411015400.10862-1-simon.marchi@polymtl.ca> X-Barracuda-Connect: smtp.electronicbox.net[96.127.255.82] X-Barracuda-Start-Time: 1523411642 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1932 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.49761 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-IsSubscribed: yes It seems like since commit f17d9474776e ("Clear non-significant bits of address in watchpoint") the test gdb.arch/aarch64-tagged-pointer.exp does not run because of: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c:49:12: error: redefinition of 'i' for (int i = 0; i < 2; i++) ^ /home/simark/src/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c:35:7: note: previous definition of 'i' was here int i = 1234; ^ /home/simark/src/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c:49:3: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < 2; i++) ^ /home/simark/src/binutils-gdb/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c:49:3: note: use option -std=c99 or -std=gnu99 to compile your code This patch tries to fix it by using a different variable (j) for the loop. With this patch, the test passes on the gcc116 machine of the build farm. gdb/testsuite/ChangeLog: * gdb.arch/aarch64-tagged-pointer.c (main): Use a different variable in for loop. --- gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c b/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c index c6fad0aae850..17b8a24f0528 100644 --- a/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c +++ b/gdb/testsuite/gdb.arch/aarch64-tagged-pointer.c @@ -33,6 +33,7 @@ main (void) struct s s1; struct s *sp1, *sp2; int i = 1234; + int j; int *p1, *p2; s1.i = 1234; @@ -46,7 +47,7 @@ main (void) func_ptr = (void (*) (void)) ((uintptr_t) func_ptr | 0xf000000000000000ULL); sp2->i = 4321; /* breakpoint here. */ - for (int i = 0; i < 2; i++) + for (j = 0; j < 2; j++) { foo (); (*func_ptr) ();