Skip to content

Commit c5a47b4

Browse files
committed
Fix printf warnings on Windows
~~~ D:\a\quickjs\quickjs\quickjs.c(1439,20): warning C4777: 'printf' : format string '%llu' requires an argument of type 'unsigned __int64', but variadic argument 1 has type 'size_t' [D:\a\quickjs\quickjs\build\qjs.vcxproj] D:\a\quickjs\quickjs\quickjs.c(1439,20): the sizes of types 'size_t' and 'unsigned __int64' might differ on other platforms D:\a\quickjs\quickjs\quickjs.c(1439,20): consider using '%zu' in the format string ~~~
1 parent 323a048 commit c5a47b4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

quickjs.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,8 +1436,7 @@ static void js_trigger_gc(JSRuntime *rt, size_t size)
14361436
if (force_gc) {
14371437
#ifdef DUMP_GC
14381438
if (check_dump_flag(rt, DUMP_GC)) {
1439-
printf("GC: size=%" PRIu64 "\n",
1440-
(uint64_t)rt->malloc_state.malloc_size);
1439+
printf("GC: size=%zd\n", rt->malloc_state.malloc_size);
14411440
}
14421441
#endif
14431442
JS_RunGC(rt);
@@ -2277,9 +2276,9 @@ void JS_FreeRuntime(JSRuntime *rt)
22772276
if (s->malloc_count > 1) {
22782277
if (rt->rt_info)
22792278
printf("%s:1: ", rt->rt_info);
2280-
printf("Memory leak: %"PRIu64" bytes lost in %"PRIu64" block%s\n",
2281-
(uint64_t)(s->malloc_size - sizeof(JSRuntime)),
2282-
(uint64_t)(s->malloc_count - 1), &"s"[s->malloc_count == 2]);
2279+
printf("Memory leak: %zd bytes lost in %zd block%s\n",
2280+
s->malloc_size - sizeof(JSRuntime),
2281+
s->malloc_count - 1, &"s"[s->malloc_count == 2]);
22832282
}
22842283
}
22852284
#endif

0 commit comments

Comments
 (0)