Thread overview
[Issue 11331] Inefficient initialization of struct with members = void
Apr 23, 2016
Jack Stouffer
Sep 11, 2016
gyroheli@gmail.com
Oct 10, 2016
Martin Nowak
Aug 25, 2017
anonymous4
Aug 25, 2017
anonymous4
Aug 25, 2017
anonymous4
Aug 25, 2017
anonymous4
Apr 09, 2018
Shachar Shemesh
Dec 17, 2022
Iain Buclaw
April 23, 2016
https://issues.dlang.org/show_bug.cgi?id=11331

Jack Stouffer <jack@jackstouffer.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |performance
                 CC|                            |jack@jackstouffer.com

--
September 11, 2016
https://issues.dlang.org/show_bug.cgi?id=11331

gyroheli@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gyroheli@gmail.com

--- Comment #5 from gyroheli@gmail.com ---
Is anything being worked on to change this?

--
October 10, 2016
https://issues.dlang.org/show_bug.cgi?id=11331

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@dawg.eu

--- Comment #6 from Martin Nowak <code@dawg.eu> ---
It's almost somewhat of a language fix, b/c they are silently ignored, everybody expects them to work (seen that discussion/mistake several times already, recent occurence https://forum.dlang.org/post/ntfrgh$1l2n$1@digitalmars.com).

Until we use that information for more efficient initialization we should probably warn about that = void on a struct field has no effect.

--
August 25, 2017
https://issues.dlang.org/show_bug.cgi?id=11331

--- Comment #7 from anonymous4 <dfj1esp02@sneakemail.com> ---
*** Issue 15951 has been marked as a duplicate of this issue. ***

--
August 25, 2017
https://issues.dlang.org/show_bug.cgi?id=11331

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #8 from anonymous4 <dfj1esp02@sneakemail.com> ---
*** Issue 11817 has been marked as a duplicate of this issue. ***

--
August 25, 2017
https://issues.dlang.org/show_bug.cgi?id=11331

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=10643

--
August 25, 2017
https://issues.dlang.org/show_bug.cgi?id=11331

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec

--
April 09, 2018
https://issues.dlang.org/show_bug.cgi?id=11331

Shachar Shemesh <shachar@weka.io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shachar@weka.io

--
May 24, 2018
https://issues.dlang.org/show_bug.cgi?id=11331

johanengelen@weka.io changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johanengelen@weka.io

--- Comment #9 from johanengelen@weka.io ---
Assignment with T.init is used to remove dangling pointers after destruction:
https://github.com/dlang/druntime/blob/54ab96e9977e0c6baa7ed9740810058fd4aec6ef/src/object.d#L3082-L3098
So if spec is changed/clarified on this issue, we probably need to change/fix
that code too. (if there isn't already, we need help from traits to figure out
which members are =void, such that we can zero them explicitly)

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=11331

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--