File 0207-Suppress-compiler-warnings.patch of Package erlang
From 1cff2390d62cee0ab3852c840816787b3dbe20ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Tue, 29 Oct 2024 09:57:29 +0100
Subject: [PATCH] Suppress compiler warnings
Compiler warnings for using uninitalized variables started
to appear when we started to build DEBUG builds with -Og.
The variables in question are not actually unitinialized.
---
erts/emulator/beam/beam_load.c | 2 ++
erts/emulator/beam/io.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 945b84ba2e..76fbf19a19 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -504,6 +504,8 @@ static int load_code(LoaderState* stp)
int specific, arity, arg, i;
Uint32 mask[3] = {0, 0, 0};
+ ERTS_UNDEF(arity, 0); /* Suppress warning. */
+
if (num_specific != 0) {
/* The `bs_append` instruction made obsolete in
* Erlang/OTP 28 has 8 operands. Therefore, the if
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 78efccc376..31f13b0ba9 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -4277,7 +4277,9 @@ erts_port_control(Process* c_p,
return ERTS_PORT_OP_BADARG;
try_call = !(sched_flags & ERTS_PTS_FLGS_FORCE_SCHEDULE_OP);
+
binp = NULL;
+ ERTS_UNDEF(br, NULL); /* Suppress warning. */
if (is_bitstring(data)) {
ERTS_DECLARE_DUMMY(Eterm br_flags);
--
2.43.0