From 3507388e87a1aaac8f0b5cd1345e0ad4241a6f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 2 Mar 2026 09:21:01 +0100 Subject: [PATCH] unix: fix compilation warnings with GCC 15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ~~~ libuv/src/unix/internal.h: In function ‘uv__basename_r’: libuv/src/unix/internal.h:480:12: warning: return discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 480 | return s + 1; libuv/src/unix/linux.c: In function ‘uv__cgroup1_find_cpu_controller’: libuv/src/unix/linux.c:2377:22: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 2377 | char* cgroup_cpu = strstr(cgroup, ":cpu,"); | ^~~~~~ libuv/src/unix/linux.c: In function ‘uv_cpu_info’: libuv/src/unix/linux.c:1903:20: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 1903 | .model = p + c->model * sizeof(*model), | ^ ~~~ --- src/unix/internal.h | 2 +- src/unix/linux.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/unix/internal.h b/src/unix/internal.h index 360e425a5..dcd5f95e2 100644 --- a/src/unix/internal.h +++ b/src/unix/internal.h @@ -473,7 +473,7 @@ UV_UNUSED(static void uv__update_time(uv_loop_t* loop)) { UV_UNUSED(static char* uv__basename_r(const char* path)) { char* s; - s = strrchr(path, '/'); + s = strrchr((char*) path, '/'); if (s == NULL) return (char*) path; diff --git a/src/unix/linux.c b/src/unix/linux.c index e98f3811c..2b55e1ba3 100644 --- a/src/unix/linux.c +++ b/src/unix/linux.c @@ -1639,7 +1639,7 @@ done: int uv_resident_set_memory(size_t* rss) { char buf[1024]; - const char* s; + char* s; long val; int rc; int i; @@ -1900,7 +1900,7 @@ nocpuinfo: c = *cpus + cpu; (*ci)[i++] = (uv_cpu_info_t) { - .model = p + c->model * sizeof(*model), + .model = (char*) p + c->model * sizeof(*model), .speed = c->freq / 1000, /* Note: sysconf(_SC_CLK_TCK) is fixed at 100 Hz, * therefore the multiplier is always 1000/100 = 10. @@ -2374,7 +2374,7 @@ next: static char* uv__cgroup1_find_cpu_controller(const char* cgroup, int* cgroup_size) { /* Seek to the cpu controller line. */ - char* cgroup_cpu = strstr(cgroup, ":cpu,"); + char* cgroup_cpu = strstr((char*) cgroup, ":cpu,"); if (cgroup_cpu != NULL) { /* Skip the controller prefix to the start of the cgroup path. */