home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!edcastle!aiai!richard
- From: richard@aiai.ed.ac.uk (Richard Tobin)
- Newsgroups: comp.std.c
- Subject: Re: Character arrays in structures and address alignment -- any standard?
- Message-ID: <7022@skye.ed.ac.uk>
- Date: 30 Jul 92 15:14:42 GMT
- References: <1992Jul28.063356.28005@sq.sq.com> <14216@ksr.com> <Bs5pMJ.3nM@twwells.com>
- Organization: Templi Resurgentes Equites Synarchici
- Lines: 21
-
- 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.
-
- (1.7 Compliance)
-
- "A strictly conforming program ... shall not produce output dependent
- on any unspecified, undefined, or implementation-defined behavior"
-
- -- Richard
- --
- Richard Tobin,
- AI Applications Institute, R.Tobin@ed.ac.uk
- Edinburgh University.
-