🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52221

Is there any way to guarantee alignment or capture misalignment?

#52221
From: Alice Uyeno
Date: Wed, 20 Jan 1993 18:16
13 lines
1420 bytes
HI,

I was wondering whether anyone had figured out a way to either guarantee alignment or capture misalignment in the case where structures are contained within other structures.  For example, 

      struct foo {
          struct p1 foo1;
          struct p2 foo2;
          struct p3 foo3;
      };


Is there anyway to make sure that the structure foo2 starts on a longword boundary?  Right now we're just making sure that the person responsible for defining each one of the structures makes sure that the size of their structure is a multiple of 4.  Is there any easier way?  We want to be able to detect the misalignment in case someone messes up unintentionally.           
Technical Details
Message-ID: <1993Jan20.181605.28813@ryn.mro4.dec.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!nntpd.lkg.dec.com!ryn.mro4.dec.com!subsys.enet.dec.com!uyeno

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,9a857589482c9a6d,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-01-20 14:07:36 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!nntpd.lkg.dec.com!ryn.mro4.dec.com!subsys.enet.dec.com!uyeno
From: uyeno@subsys.enet.dec.com (Alice Uyeno)
Subject: Is there any way to guarantee alignment or capture misalignment?
Message-ID: <1993Jan20.181605.28813@ryn.mro4.dec.com>
Lines: 13
Sender: news@ryn.mro4.dec.com (USENET News System)
Reply-To: uyeno@subsys.enet.dec.com (Alice Uyeno)
Organization: Digital Equipment Corporation
Date: Wed, 20 Jan 1993 18:16:05 GMT