www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23390] New: value of void initialized variable is unspecified

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 puremagic.com
          Reporter: kdevel 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.

--
Oct 06 2022