From 39549caef4ae5e5adb5a52518d195f367315e9e9 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 21 May 2021 17:26:24 -0700 Subject: sim/d10v: Use offsetof in a static assertion about structure layout. clang 11 fails to compile the static assertion as it cannot compute the pointer value at a compile time: gdb/sim/d10v/interp.c:1149:37: error: static_assert expression is not an integral constant expression static_assert ((uintptr_t) &State == (uintptr_t) &State.regs, ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Instead, assert that the offset of State.regs is 0. sim/d10v/ChangeLog: * interp.c (sim_create_inferior): Use offsetof in static assertion. --- sim/d10v/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sim/d10v/ChangeLog') diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index e45bd38..e633352 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,8 @@ +2021-05-22 John Baldwin + + * interp.c (sim_create_inferior): Use offsetof in static + assertion. + 2021-05-17 Mike Frysinger * sim-main.h (SIM_HAVE_COMMON_SIM_STATE): Delete. -- cgit v1.1