From 35c2230734e65e8ab55aa718ca6ea02ca9622984 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Sun, 19 Oct 2025 15:11:39 -0400 Subject: ZJIT: Fix binding to `INVALID_SHAPE_ID` under `-std=c99 -pedantic` ``` /src/jit.c:19:5: error: ISO C restricts enumerator values to range of 'int' (4294967295 is too large) [-Werror,-Wpedantic] 19 | RB_INVALID_SHAPE_ID = INVALID_SHAPE_ID, | ^ ~~~~~~~~~~~~~~~~ ``` --- jit.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'jit.c') diff --git a/jit.c b/jit.c index b7cb05d1c3..db3fe097ef 100644 --- a/jit.c +++ b/jit.c @@ -22,6 +22,11 @@ enum robject_offsets { ROBJECT_OFFSET_AS_ARY = offsetof(struct RObject, as.ary), }; +// Manually bound in rust since this is out-of-range of `int`, +// so this can't be in a `enum`, and we avoid `static const` +// to avoid allocating storage for the constant. +const shape_id_t rb_invalid_shape_id = INVALID_SHAPE_ID; + unsigned int rb_iseq_encoded_size(const rb_iseq_t *iseq) { -- cgit v1.2.3