Subject: Re: [PATCH 1/9] Define a structure for object IDs.

From: David Kastrup <[email-masked]>
Date: Mon, 05 May 2014 07:19:35 +0200

Andreas Schwab <[email-masked]> writes:

> Johannes Sixt <[email-masked]> writes:
>
>> Isn't internal padding only allowed between members to achieve correct
>> alignment of later members, and at the end only sufficient padding so
>> that members are aligned correctly when the struct is part of an array?
>
> The standard allows arbitrary internal padding, it doesn't have to be
> minimal.

What the standard does guarantee is that a pointer to a struct can be
cast to a pointer to its first member and vice versa.  It does not as
far as I can see guarantee that a pointer to something of the same type
of its first member can be converted to a pointer to a struct even if
the struct only contains a member of such type.

-- 
David Kastrup