From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 4ADB93858004; Sun, 7 Aug 2022 14:03:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4ADB93858004 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/build] Fix build with gcc 4.8.5 X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: c7cd10637c40a72564bc813f3f16a4ba4b13d21b X-Git-Newrev: 411c7e044fa99089d3030f2c61525c4d415f7b45 Message-Id: <20220807140305.4ADB93858004@sourceware.org> Date: Sun, 7 Aug 2022 14:03:05 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2022 14:03:05 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D411c7e044fa9= 9089d3030f2c61525c4d415f7b45 commit 411c7e044fa99089d3030f2c61525c4d415f7b45 Author: Tom de Vries Date: Sun Aug 7 16:03:00 2022 +0200 [gdb/build] Fix build with gcc 4.8.5 =20 When building with gcc 4.8.5, I run into: ... user-regs.c:85:1: error: could not convert \ =E2=80=98{0l, (& builtin_user_regs.gdb_user_regs::first)}=E2=80=99 fr= om \ =E2=80=98=E2=80=99 to =E2=80=98gdb_u= ser_regs=E2=80=99 }; ^ ... =20 Fix this by removing the initialization and handling regs.last =3D=3D n= ullptr in append_user_reg. =20 Tested on x86_64-linux. Diff: --- gdb/user-regs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/user-regs.c b/gdb/user-regs.c index 4bc4685387f..05bb04ef2ed 100644 --- a/gdb/user-regs.c +++ b/gdb/user-regs.c @@ -74,15 +74,15 @@ append_user_reg (struct gdb_user_regs *regs, const char= *name, reg->xread =3D xread; reg->baton =3D baton; reg->next =3D NULL; + if (regs->last =3D=3D nullptr) + regs->last =3D ®s->first; (*regs->last) =3D reg; regs->last =3D &(*regs->last)->next; } =20 /* An array of the builtin user registers. */ =20 -static struct gdb_user_regs builtin_user_regs =3D { - NULL, &builtin_user_regs.first -}; +static struct gdb_user_regs builtin_user_regs; =20 void user_reg_add_builtin (const char *name, user_reg_read_ftype *xread,