git: 9a4813e1dc17 - main - bhyve: Fix the build with gcc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 11 Jun 2024 13:12:56 UTC
The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9a4813e1dc1781d952d8db017fc7cc005095c6a0 commit 9a4813e1dc1781d952d8db017fc7cc005095c6a0 Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2024-06-11 08:49:32 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2024-06-11 13:12:43 +0000 bhyve: Fix the build with gcc gcc doesn't like const and static to not be at the start of a variable declaration. Update the gdb_regset arrays to make it more obvious they are arrays of struct gdb_reg and to fix the gcc build. Reviewed by: corvink, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45550 --- usr.sbin/bhyve/gdb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index 6df8026a0245..a13166e1e2c8 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -166,10 +166,10 @@ static bool gdb_active = false; struct gdb_reg { enum vm_reg_name id; int size; -} +}; #ifdef __amd64__ -static const gdb_regset[] = { +static const struct gdb_reg gdb_regset[] = { { .id = VM_REG_GUEST_RAX, .size = 8 }, { .id = VM_REG_GUEST_RBX, .size = 8 }, { .id = VM_REG_GUEST_RCX, .size = 8 }, @@ -212,7 +212,7 @@ static const gdb_regset[] = { { .id = VM_REG_GUEST_EFER, .size = 8 }, }; #else /* __aarch64__ */ -static const gdb_regset[] = { +static const struct gdb_reg gdb_regset[] = { { .id = VM_REG_GUEST_X0, .size = 8 }, { .id = VM_REG_GUEST_X1, .size = 8 }, { .id = VM_REG_GUEST_X2, .size = 8 },