[Issue 18016] using uninitialized value is considered @safe but has undefined behavior

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 5 18:53:41 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=18016

ag0aep6g <ag0aep6g at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #18 from ag0aep6g <ag0aep6g at gmail.com> ---
(In reply to ag0aep6g from comment #0)
> I see a couple different ways to approach to this:
[...]
> 2) Give some defined behavior to void initialized values (without
> indirections). For example, say that the value of `x` is unpredictable, but
> that the program at large is unaffected (no undefined behavior). With this
> approach, issue 15542 would become actual. That is, `pure` would need
> special consideration.
[...]

Walter has chosen this option in <https://github.com/dlang/dlang.org/pull/2990>
which has been merged. But he didn't bother updating this issue. Closing as
fixed.

As mentioned before, this revives issue 15542.

--


More information about the Digitalmars-d-bugs mailing list