# Compiler repotrs overflow warning when compiling otp\_src\_27.2.2

**URL:** <https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475>\
**Category:** Questions / Help\
**Tags:** erlang-otp\
**Created:** [February 10, 2025, 12:27pm UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475 "2025-02-10T12:27:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![g4v](https://erlangforums.com/letter_avatar_proxy/v4/letter/g/f05b48/32.png) [@g4v](https://erlangforums.com/u/g4v)\
**Post date:** [February 10, 2025, 12:27pm UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475/1 "2025-02-10T12:27:49Z")

</div>

please excuse if i posted to a wrong category.

i’m a bit concerned because when compiling otp\_src\_27.2.2 the following warning is reported by gcc:

```erlang
CC obj/aarch64-unknown-linux-gnu/opt/jit/dist.o
In file included from ../include/internal/gcc/ethread.h:347,
                 from ../include/internal/ethread.h:389,
                 from beam/erl_threads.h:252,
                 from beam/sys.h:539,
                 from beam/dist.c:37:
In function 'ethr_native_atomic64_set_relb',
    inlined from 'ethr_atomic_set_mb' at ../include/internal/ethr_atomics.h:4019:5,
    inlined from 'erts_dist_command' at beam/dist.c:3867:5:
../include/internal/gcc/ethr_atomic.h:144:5: warning: '__atomic_store_8' writing 8 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
  144 | __atomic_store_n(&var->value, value,__ATOMIC_RELEASE);
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

```

question: is it safe to ignore this warning?

---

<div class="post-metadata">

**Author:** ![mikpe](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mikpe](https://erlangforums.com/u/mikpe)\
**Post date:** [February 10, 2025, 5:09pm UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475/2 "2025-02-10T17:09:47Z")

</div>

I also get this with gcc-14.2 on aarch64-linux-gnu. gcc has had false warnings before, and I believe this one is too, but I can’t prove that right now.

---

<div class="post-metadata">

**Author:** ![g4v](https://erlangforums.com/letter_avatar_proxy/v4/letter/g/f05b48/32.png) [@g4v](https://erlangforums.com/u/g4v)\
**Post date:** [February 10, 2025, 6:09pm UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475/3 "2025-02-10T18:09:02Z")

</div>

compiled with gcc.14.2.0-6 on x86\_64-linux-gnu and the warning this not emitted.

---

<div class="post-metadata">

**Author:** ![mikpe](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mikpe](https://erlangforums.com/u/mikpe)\
**Post date:** [February 10, 2025, 7:44pm UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475/4 "2025-02-10T19:44:52Z")

</div>

It does look like a gcc bug. I’ve reduced the preprocessed code for dist.c on aarch64-linux-gnu to a 42 line test case that triggers this warning on both aarch64 and x86\_64. Small code changes that don’t change the semantics of the source silence the warning.

---

<div class="post-metadata">

**Author:** ![mikpe](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mikpe](https://erlangforums.com/u/mikpe)\
**Post date:** [February 11, 2025, 9:29am UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475/5 "2025-02-11T09:29:21Z")

</div>

There are two bugs:

1. On the gcc side, the warning is valid, but the message is misleading and it doesn’t always trigger as it should. There’s a gcc upstream bug report about that.
2. On the BEAM side, there is a missing NULL pointer check in the source code. However, it appears that it “cannot” happen at runtime. There is a pull request on GH now to silence the warning.

You can ignore the warning.

---

<div class="post-metadata">

**Author:** ![g4v](https://erlangforums.com/letter_avatar_proxy/v4/letter/g/f05b48/32.png) [@g4v](https://erlangforums.com/u/g4v)\
**Post date:** [February 11, 2025, 12:41pm UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475/6 "2025-02-11T12:41:13Z")

</div>

thank you very much for your efforts.

should i close this topic?

---

<div class="post-metadata">

**Author:** ![mikpe](https://erlangforums.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mikpe](https://erlangforums.com/u/mikpe)\
**Post date:** [February 11, 2025, 1:04pm UTC](https://erlangforums.com/t/compiler-repotrs-overflow-warning-when-compiling-otp-src-27-2-2/4475/7 "2025-02-11T13:04:12Z")

</div>

> should i close this topic?

Yes please.
