better compiler warnings adn errors

This commit is contained in:
2026-02-20 12:40:49 -06:00
parent 54e5be0773
commit 8d449e6fc6
10 changed files with 679 additions and 93 deletions

View File

@@ -30,6 +30,7 @@ cell_rt *root_cell = NULL;
static char *shop_path = NULL;
static char *core_path = NULL;
static int native_mode = 0;
static int warn_mode = 1;
static JSRuntime *g_runtime = NULL;
// Compute blake2b hash of data and return hex string (caller must free)
@@ -523,6 +524,9 @@ int cell_init(int argc, char **argv)
} else if (strcmp(argv[arg_start], "--native") == 0) {
native_mode = 1;
arg_start++;
} else if (strcmp(argv[arg_start], "--no-warn") == 0) {
warn_mode = 0;
arg_start++;
} else {
break;
}
@@ -661,11 +665,14 @@ int cell_init(int argc, char **argv)
JS_SetPropertyStr(ctx, env_ref.val, "actorsym", JS_DupValue(ctx, cli_rt->actor_sym_ref.val));
tmp = js_core_json_use(ctx);
JS_SetPropertyStr(ctx, env_ref.val, "json", tmp);
if (native_mode) {
if (native_mode || !warn_mode) {
JSGCRef init_ref;
JS_AddGCRef(ctx, &init_ref);
init_ref.val = JS_NewObject(ctx);
JS_SetPropertyStr(ctx, init_ref.val, "native_mode", JS_NewBool(ctx, 1));
if (native_mode)
JS_SetPropertyStr(ctx, init_ref.val, "native_mode", JS_NewBool(ctx, 1));
if (!warn_mode)
JS_SetPropertyStr(ctx, init_ref.val, "no_warn", JS_NewBool(ctx, 1));
JS_SetPropertyStr(ctx, env_ref.val, "init", init_ref.val);
JS_DeleteGCRef(ctx, &init_ref);
} else {