diff options
Diffstat (limited to 'src/wasm-interp-sq.c')
-rw-r--r-- | src/wasm-interp-sq.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/wasm-interp-sq.c b/src/wasm-interp-sq.c index 13b460ec..a70610cb 100644 --- a/src/wasm-interp-sq.c +++ b/src/wasm-interp-sq.c @@ -225,14 +225,16 @@ static WasmResult init_thread(WasmAllocator* allocator, &s_thread_options); } -static void squirrel_print(HSQUIRRELVM v, const char* format, ...) { +static void WASM_PRINTF_FORMAT(2, 3) + squirrel_print(HSQUIRRELVM v, const char* format, ...) { va_list args; va_start(args, format); vfprintf(stdout, format, args); va_end(args); } -static void squirrel_error(HSQUIRRELVM v, const char* format, ...) { +static void WASM_PRINTF_FORMAT(2, 3) + squirrel_error(HSQUIRRELVM v, const char* format, ...) { va_list args; va_start(args, format); vfprintf(stderr, format, args); @@ -312,7 +314,11 @@ static SQInteger squirrel_errorhandler(HSQUIRRELVM v) { const char* funcname = stack_info.funcname ? stack_info.funcname : "unknown"; SQInteger line = stack_info.line; - squirrel_error(v, " #%d: %s:%d: %s()\n", depth, source, line, funcname); + squirrel_error(v, + " #"_PRINT_INT_FMT + ": %s:"_PRINT_INT_FMT + ": %s()\n", + depth, source, line, funcname); } } return 0; |