Path: utzoo!attcan!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.std.c Subject: Re: Size of structure containing char fields Message-ID: <356@taumet.com> Date: 28 Jul 90 21:43:16 GMT References: <1030@lzaz.ATT.COM> <8631@cognos.UUCP> Organization: Taumetric Corporation, San Diego Lines: 16 jimp@cognos.UUCP (Jim Patterson) writes: >Sun's C compiler on a Sun 3 (with Sun OS 4.0) aligns structs on two >byte boundaries. This is NOT an ANSI-compatible compiler, but I don't >think that the ANSI standard will force them to change their ways. As you noted, the ANSI standard allows padding between and at the end of a struct. The standard does not (and cannot) say anything about where a data object must be located in memory. Recall it is the struct object, not the struct data type, which is being aligned. That object has an address, and whether one or more bytes preceding it in memory are used or not is not business of the Standard. In any event, no portable program can access such bytes, even if they exist. -- Steve Clamage, TauMetric Corp, steve@taumet.com