On Fri, Nov 30, 2018 at 13:59:11 +0100, Martin Husemann wrote:

> On Fri, Nov 30, 2018 at 07:47:38AM -0500, Christos Zoulas wrote:
> > We need to see if the spec says so. I am not sure if we can depend
> > that an implementation does it.
> 
> The spec only talks about members not named in the list - I can't see
> any hints about padding. 
> 
> Might be worth to ask some std gurus for clarification.

I'm not one, but search for "padding" in 6.2.6.1 General (in 6.2.6
Representations of types).

       [#6]  When  a  value  is stored in an object of structure or
       union type, including in a member object, the bytes  of  the
       object  representation  that correspond to any padding bytes
       take  unspecified  values.42)

       42)Thus,  for   example,   structure   assignment   may   be
          implemented element-at-a-time or via memcpy.

so padding may contain garbage.

-uwe

Reply via email to