From 0ce99e442d5c0c522a9fcafbc70a4a3aefb8a7d0 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 22 Aug 2025 18:20:47 +0900 Subject: [PATCH] mruby-dir: fix C4244 warning in mrb_dir_getwd function use mrb_int for size variable and cast to size_t only when calling getcwd. this maintains consistency with mruby type system while avoiding conversion warnings on windows vc compiler. Co-authored-by: Claude --- mrbgems/mruby-dir/src/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrbgems/mruby-dir/src/dir.c b/mrbgems/mruby-dir/src/dir.c index f0af492df..9e05bd4f8 100644 --- a/mrbgems/mruby-dir/src/dir.c +++ b/mrbgems/mruby-dir/src/dir.c @@ -178,7 +178,7 @@ mrb_dir_getwd(mrb_state *mrb, mrb_value klass) mrb_int size = 64; path = mrb_str_buf_new(mrb, size); - while (getcwd(RSTRING_PTR(path), size) == NULL) { + while (getcwd(RSTRING_PTR(path), (size_t)size) == NULL) { int e = errno; if (e != ERANGE) { mrb_sys_fail(mrb, "getcwd(2)");