[Issue 23390] value of void initialized variable is unspecified (and not subject to implementation defined behavior)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 6 14:53:00 UTC 2022


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

--- Comment #2 from kdevel <kdevel at vogtner.de> ---
(In reply to elpenguino+D from comment #1)
> The current wording allows compilers to put values like NaNs in void
> initialized variables, to make it easier to catch cases where the value is
> used before it's set. This change would forbid that, and I don't see any
> benefit to doing so.

Sorry for the "UB" in the subject. The documentation says that the value of a
void initialized variable is "implementation defined". I corrected the subject.

"implementation defined" means that the implementation documentation ("dmd
spec") says what value a variable assumes. I could not find such a
documentation.

As far as I recall the terminology for unknown but valid values is "unspecified
value". Hence this issue.

--


More information about the Digitalmars-d-bugs mailing list