[Issue 23390] New: value of void initialized variable is unspecified (and not subject to UB)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 6 12:14:03 UTC 2022


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

          Issue ID: 23390
           Summary: value of void initialized variable is unspecified (and
                    not subject to UB)
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dlang.org
          Assignee: nobody at puremagic.com
          Reporter: kdevel at vogtner.de

Source: https://forum.dlang.org/post/ylnkspqzfsnrvojmtqwm@forum.dlang.org

| >> I got the answer thanks to IRC chat:
https://dlang.org/spec/declaration.html#void_init
| > Quote:
| >
| >    Implementation Defined: If a void initialized variable's value is used
| >    before it is set, its value is implementation defined.
| >
| > Shouldn't this read
| >
| >    Unspecified Value: If a void initialized variable's value is used
| >    before it is set, its value is unspecified.
| 
| Yes, it should. Many of the contributors to the D spec are not very well
| versed in the precise details of these terms, so mistakes like this
| occasionally slip through.

--


More information about the Digitalmars-d-bugs mailing list