File 1061-erts-Fix-misc-compiler-warnings.patch of Package erlang
From f3a3f5dca8bc65acd2559fabf300cda4bd078694 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Tue, 27 Jan 2026 18:16:21 +0100
Subject: [PATCH 1/6] erts: Fix misc compiler warnings
---
erts/emulator/beam/beam_common.c | 2 +-
erts/emulator/beam/beam_common.h | 2 +-
erts/emulator/beam/bif.c | 12 ++++++------
erts/emulator/beam/dist.c | 10 ++++------
erts/lib_src/common/erl_misc_utils.c | 4 ++++
5 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/erts/emulator/beam/beam_common.c b/erts/emulator/beam/beam_common.c
index 0e75cb4e14..13cd65d337 100644
--- a/erts/emulator/beam/beam_common.c
+++ b/erts/emulator/beam/beam_common.c
@@ -1632,7 +1632,7 @@ call_fun(Process* p, /* Current process. */
if (is_local_fun(funp)) {
DTRACE_LOCAL_CALL(p, erts_code_to_codemfa(code_ptr));
} else {
- Export *ep = funp->entry.exp;
+ const Export *ep = funp->entry.exp;
ASSERT(is_external_fun(funp) && funp->next == NULL);
DTRACE_GLOBAL_CALL(p, &ep->info.mfa);
}
diff --git a/erts/emulator/beam/beam_common.h b/erts/emulator/beam/beam_common.h
index 62606e3657..adeb1f6361 100644
--- a/erts/emulator/beam/beam_common.h
+++ b/erts/emulator/beam/beam_common.h
@@ -216,7 +216,7 @@ do { \
#define DTRACE_GLOBAL_CALL_FROM_EXPORT(p,e) \
do { \
if (DTRACE_ENABLED(global_function_entry)) { \
- ErtsDispatchable *disp__ = &(e)->dispatch; \
+ const ErtsDispatchable *disp__ = &(e)->dispatch; \
ErtsCodePtr fp__ = disp__->addresses[erts_active_code_ix()]; \
DTRACE_GLOBAL_CALL((p), erts_code_to_codemfa(fp__)); \
} \
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index e6d277ef86..67471a5bbb 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -3894,12 +3894,11 @@ dist_port_commandv(Port *prt, ErtsDistOutputBuf *obuf)
#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(dist_outputv)) {
DistEntry *dep = (DistEntry*) erts_prtsd_get(prt, ERTS_PRTSD_DIST_ENTRY);
-
- ERTS_ASSUME(dep);
-
DTRACE_CHARBUF(port_str, 64);
DTRACE_CHARBUF(remote_str, 64);
+ ERTS_ASSUME(dep);
+
erts_snprintf(port_str, sizeof(DTRACE_CHARBUF_NAME(port_str)),
"%T", prt->common.id);
erts_snprintf(remote_str, sizeof(DTRACE_CHARBUF_NAME(remote_str)),
@@ -4750,12 +4749,11 @@ erts_dist_port_not_busy(Port *prt)
#ifdef USE_VM_PROBES
if (DTRACE_ENABLED(dist_port_not_busy)) {
DistEntry *dep = (DistEntry*) erts_prtsd_get(prt, ERTS_PRTSD_DIST_ENTRY);
-
- ERTS_ASSUME(dep);
-
DTRACE_CHARBUF(port_str, 64);
DTRACE_CHARBUF(remote_str, 64);
+ ERTS_ASSUME(dep);
+
erts_snprintf(port_str, sizeof(DTRACE_CHARBUF_NAME(port_str)),
"%T", prt->common.id);
erts_snprintf(remote_str, sizeof(DTRACE_CHARBUF_NAME(remote_str)),
diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c
index de06b65278..877cad4ae9 100644
--- a/erts/lib_src/common/erl_misc_utils.c
+++ b/erts/lib_src/common/erl_misc_utils.c
@@ -1134,6 +1134,10 @@ get_cgroup_path(const char *controller,
return ERTS_CGROUP_NONE;
}
+#ifndef VALGRIND
+ child_path = NULL; // ERTS_UNDEF
+#endif
+
version = get_cgroup_child_path(controller, &child_path);
if (version == ERTS_CGROUP_NONE) {
--
2.51.0