]> git.kaiwu.me - quickjs.git/commitdiff
removed warnings
authorFabrice Bellard <fabrice@bellard.org>
Sat, 31 Oct 2026 13:53:20 +0000 (14:53 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Sat, 31 Oct 2026 13:53:20 +0000 (14:53 +0100)
Makefile
quickjs.c
run-test262.c

index c3e34bf6e5170fba7ec053517655df4aaebd0bde..11060559f5d2ca932e4bf63190eac31036fa89f3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -133,13 +133,15 @@ else ifdef CONFIG_COSMO
   CC=cosmocc
   # cosmocc does not correct support -MF
   CFLAGS=-g -Wall #-MMD -MF $(OBJDIR)/$(@F).d
-  CFLAGS += -Wno-array-bounds -Wno-format-truncation
+  CFLAGS += -Wno-array-bounds -Wno-format-truncation -Wno-infinite-recursion
   AR=cosmoar
 else
   HOST_CC=gcc
   CC=$(CROSS_PREFIX)gcc
   CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
   CFLAGS += -Wno-array-bounds -Wno-format-truncation -Wno-infinite-recursion
+  check_warning = $(shell $(CC) $(1) -c -x c /dev/null -o /dev/null 2>/dev/null && echo $(1))
+  CFLAGS += $(call check_warning, -Wbidi-chars=unpaired)
   ifdef CONFIG_LTO
     AR=$(CROSS_PREFIX)gcc-ar
   else
index 0d6c1475e462e9a5bdc639ddd6a9a59c860b6518..ed81ff89f67ea88654dd55944a7863d41017a65e 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -30857,9 +30857,9 @@ static char *js_default_module_normalize_name(JSContext *ctx,
         return js_strdup(ctx, name);
     }
 
-    p = strrchr(base_name, '/');
-    if (p)
-        len = p - base_name;
+    r = strrchr(base_name, '/');
+    if (r)
+        len = r - base_name;
     else
         len = 0;
 
index 1a1ea945771058e121d7cd9d2089332b7b4cb0ba..f5ff048f239056124ccf14b3f92221b71442e4db 100644 (file)
@@ -328,7 +328,7 @@ char *skip_prefix(const char *str, const char *prefix)
 
 char *get_basename(const char *filename)
 {
-    char *p;
+    const char *p;
 
     p = strrchr(filename, '/');
     if (!p)
@@ -1866,7 +1866,7 @@ int run_test(ThreadLocalStorage *tls, const char *filename, int index)
 
     if (new_style) {
         if (!harness) {
-            p = strstr(filename, "test/");
+            p = (char *)strstr(filename, "test/");
             if (p) {
                 snprintf(harnessbuf, sizeof(harnessbuf), "%.*s%s",
                          (int)(p - filename), filename, "harness");
@@ -1958,7 +1958,7 @@ int run_test(ThreadLocalStorage *tls, const char *filename, int index)
         char *ifile;
 
         if (!harness) {
-            p = strstr(filename, "test/");
+            p = (char *)strstr(filename, "test/");
             if (p) {
                 snprintf(harnessbuf, sizeof(harnessbuf), "%.*s%s",
                          (int)(p - filename), filename, "test/harness");