From 3325194ac0fd9e14ab5535c80b3a9b329d030e76 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 17 Mar 2020 19:47:45 +0900 Subject: [PATCH] Get rid of bogus warning by VC ``` c:\projects\ruby\mjit_worker.c(1219) : warning C4090: 'function' : different 'const' qualifiers ``` It seems confused by passing "pointer to pointer to const object", not "pointer to const object". --- mjit_worker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mjit_worker.c b/mjit_worker.c index fe2754eedf..eab7501ace 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -1216,7 +1216,8 @@ mjit_capture_cc_entries(const struct rb_iseq_constant_body *compiled_iseq, const if (cc_entries == NULL) return -1; } else { - cc_entries = realloc(unit->cc_entries, sizeof(struct rb_callcache *) * new_entries_size); + void *cc_ptr = (void *)unit->cc_entries; // get rid of bogus warning by VC + cc_entries = realloc(cc_ptr, sizeof(struct rb_callcache *) * new_entries_size); if (cc_entries == NULL) return -1; unit->cc_entries = cc_entries; cc_entries += cc_entries_index;