From 10dde7db299f2a23f7658b0ef53b3d03752cafe7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 26 Apr 2024 10:24:36 +0300 Subject: [PATCH] Avoid compiler warning in igc.c * src/igc.c (fix_weak_ref): Avoid compiler warning about dereferencing type-punned pointer, which breaks strict-aliasing rules. --- src/igc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/igc.c b/src/igc.c index c2dd837a455..89a2ac3d9a7 100644 --- a/src/igc.c +++ b/src/igc.c @@ -1034,7 +1034,9 @@ fix_weak_ref (mps_ss_t ss, struct Lisp_Weak_Ref *wref) { MPS_SCAN_BEGIN (ss) { - const mps_word_t tagged_word = *(mps_word_t *)&wref->ref; + /* FIXME: The below explicitly assumes Lisp_Object is of the same + width as mps_word_t! */ + const mps_word_t tagged_word = (ptrdiff_t) igc_weak_ref_deref (wref); const enum Lisp_Type tag = tagged_word & IGC_TAG_MASK; switch (tag)