public inbox for
help / color / mirror / Atom feed
From: Tom de Vries <>
Subject: [binutils-gdb] [gdb/build] Fix build with gcc 4.8.5
Date: Sun,  7 Aug 2022 14:03:05 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=411c7e044fa99089d3030f2c61525c4d415f7b45

commit 411c7e044fa99089d3030f2c61525c4d415f7b45
Author: Tom de Vries <>
Date:   Sun Aug 7 16:03:00 2022 +0200

    [gdb/build] Fix build with gcc 4.8.5
    When building with gcc 4.8.5, I run into:
    user-regs.c:85:1: error: could not convert \
      ‘{0l, (& builtin_user_regs.gdb_user_regs::first)}’ from \
      ‘<brace-enclosed initializer list>’ to ‘gdb_user_regs’
    Fix this by removing the initialization and handling regs.last == nullptr in
    Tested on x86_64-linux.

 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 = xread;
   reg->baton = baton;
   reg->next = NULL;
+  if (regs->last == nullptr)
+    regs->last = &regs->first;
   (*regs->last) = reg;
   regs->last = &(*regs->last)->next;
 /* An array of the builtin user registers.  */
-static struct gdb_user_regs builtin_user_regs = {
-  NULL, &builtin_user_regs.first
+static struct gdb_user_regs builtin_user_regs;
 user_reg_add_builtin (const char *name, user_reg_read_ftype *xread,

             reply	other threads:[~2022-08-07 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07 14:03 Tom de Vries [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-12 11:37 Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).