🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #74

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

#74
From: T. William Wells
Date: Fri, 31 Jul 1992 21:12
21 lines
1157 bytes
In article <7022@skye.ed.ac.uk> richard@aiai.ed.ac.uk (Richard Tobin) writes:
: In article <Bs5pMJ.3nM@twwells.com> bill@twwells.com (T. William Wells) writes:
: >: Please show a strictly conforming program which can tell the difference
: >: between "necessary" padding and "unnecessary" padding.
:
: >For example:
:
: >     printf("%d\n", (offsetof(foo, y) - offset(foo, x)) - sizeof(int));
:
: *If* the standard allows "unnecessary" padding, this program is not
: strictly conforming.

The original question was *supposing that the standard forbids
unnecessary padding* show a strictly conforming program that
would be able to tell the difference.

Sigh.

---
Bill                            { uunet | decwrl | telesci }!twwells!bill
bill@twwells.com
Technical Details
Message-ID: <Bs9uw3.1B8@twwells.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!twwells!bill
References: <14216@ksr.com> <Bs5pMJ.3nM@twwells.com> <7022@skye.ed.ac.uk>

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: <14216@ksr.com> <Bs5pMJ.3nM@twwells.com> <7022@skye.ed.ac.uk>
Message-ID: <Bs9uw3.1B8@twwells.com>
Date: Fri, 31 Jul 1992 21:12:01 GMT
Lines: 21