🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #151

Re: Character arrays in structures and address alignment -- any standard?

#151
From: T. William Wells
Date: Tue, 11 Aug 1992 20:29
22 lines
1518 bytes
In article <1947@sdrc.COM> scjones@thor.sdrc.com (Larry Jones) writes:
: > "There may be unnamed padding within a structure object, but not
: > at its beginning, as necessary to achieve the appropriate alignment."
: This wording was chosen very carefully -- in particular, the use of
: "appropriate" as opposed to "necessary".  It is the implementor who
: decides what alignment is "appropriate", so anything goes.

But it must be "alignment", right? Which means: a requirement that
objects of a particular type be located on storage boundaries with
addresses that are particular multiples of a byte address".

I would argue, then, that the implementer gets to pick the
alignment that goes with each type but that when padding
structures, must adhere to that alignment. This leaves open one
other possibility: the implementer could add additional padding
of `n*alignment' bytes which would still result in alignment but
wouldn't be the minimum necessary. The question is whether one
can argue for or against that possibility.

---
Bill                            { uunet | decwrl | telesci }!twwells!bill
bill@twwells.com
Technical Details
Message-ID: <Bsu69E.H3t@twwells.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!twwells!bill
References: <7022@skye.ed.ac.uk> <14382@ksr.com> <1947@sdrc.COM>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!twwells!bill
From: bill@twwells.com (T. William Wells)
Subject: Re: Character arrays in structures and address alignment -- any standard?
Organization: None, Mt. Laurel, NJ
References: <7022@skye.ed.ac.uk> <14382@ksr.com> <1947@sdrc.COM>
Message-ID: <Bsu69E.H3t@twwells.com>
Date: Tue, 11 Aug 1992 20:29:33 GMT
Lines: 22