Are padding bits always zero?

Honey via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 24 08:09:43 PDT 2017


On Saturday, 24 June 2017 at 14:03:16 UTC, Adam D. Ruppe wrote:
> On Saturday, 24 June 2017 at 12:41:47 UTC, Steven Schveighoffer 
> wrote:
>> There is no spec for this, but I know that when the compiler 
>> has to fill gaps with something it chooses 0.
>
> I'm almost certain there at least used to be a spec for this, 
> because I remember citing a link to someone who then complained 
> that this zero requirement hurt optimization of void members. 
> On the other hand though, the zero padding requirement does 
> simplify equality to being memcmp.

The only hint I could find is this statement from Walter:

    http://forum.dlang.org/post/hn11oh$1usk$1@digitalmars.com




More information about the Digitalmars-d-learn mailing list