AFAIK, by default ISO C compilers must allocate structure members
in the declared order and no padding before the first member.
Though I suppose the clever security theater folks have pragmas
to override this.

> On Sep 2, 2026, at 9:08 AM, ron minnich <[email protected]> wrote:
> 
> Thierry, is your comment re the first struct member address aligning to the 
> struct address still true in a world in which many C compilers randomize 
> struct layout? I'm guessing not.
> 
> 
> On Wed, Sep 2, 2026 at 7:30 AM <[email protected]> wrote:
> On Wed, Sep 02, 2026 at 10:13:51AM +0200, Shawn Rutledge wrote:
> > 
> > Lack of shared data structure implementations is one of the main downsides 
> > to C.  What?s your favorite workaround?
> > 
> 
> But since it is a guaranteed that the first member of a structure is
> at the same address as the structure, one can cast to a shared
> structure given as the first member of extended or overloaded
> structures.
> --
> Thierry Laronde <tlaronde +AT+ kergis +dot+ com>
>              http://www.kergis.com/
>             http://kertex.kergis.com/
> Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C
> 9fans / 9fans / see discussions + participants + delivery options Permalink

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Td859d3c6cefc922f-Ma6fd32c3636b21e07d42d30f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to